10.24 work notes--solve the problem of Linux_jni compiling error

Source: Internet
Author: User

The company is using Opus Open Source Library, so encountered some problems.

After I replace the old version with the newly downloaded opus1.1, it is no problem to compile the opus separately, but the compilation-related files will be error-free.

The error message is as follows:

g++-wall-fpic-shared libusc_jni.o libusc.a. /api/libopus.a. /api/libspeex.a. /API/LIBAMRNB.A. /api/libpcre.a-o libusc_jni.so-l.-lusc/usr/bin/ld:.. /API/LIBOPUS.A (CELT.O): Relocation r_x86_64_32s against '. Rodata ' can not is used when making a shared object; Recompile with-fpic. /api/libopus.a:could not read Symbols:bad valuecollect2:ld return 1make: * * * [libusc_jni.so] Error 1

What a strange thing! After a long day, found it is opus of the problem!! I thought it was a problem with other papers! Baidu reason, is because the makefile file is not compatible with 64 caused, but makefile is automatically generated through the Configure AH! Read the Configure source code, found that the number of system is automatically detected. There are no parameters to pass, so you have to manually modify the makefile.Locate the line where CFLAGS is located, and then add the following at the end:

-fpic
Recompile, make sure to clean before make! The problem is done!




10.24 Work notes-Troubleshooting Linux_jni compilation errors

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.