The minor problem encountered on amd64-Linux general technology-Linux programming and kernel information. The following is a detailed description. The first time I ran things on a 64-bit System (amd64, debian, gcc 4, jdk 1.5.0 _ 10), I simply recorded it.
The program is very simple. java calls the dynamic link library encapsulated in C ++ through jni and uses opencv. This program is successfully compiled and run on 32-bit debian.
At the beginning, we downloaded the opencv source code, compiled and generated so (/usr/local/lib), and added/etc/ld. so. conf. d/opencv. conf, execute ldconfig, compile and run the sample program (refer ).
Next, an error occurred while compiling the source code. Some people found that the 64-bit compilation should include the option-fPIC in g ++ compilation and must be added to the beginning.
Compiled successfully and lib *** is generated ***. so, when jni loads the dynamic library, it will find it in windows ***. dll, while linux/solaris will find lib ***. so.
An error occurred while executing: java: symbol lookup error:/opt/MyDemo/libPicMatcherService. so: undefined symbol: _ Z24combinePrecomputedHashesPjS_ii
The strange thing is that the function is obviously not a JNI interface, but a function called inside CPP, and it's okay to run it on 32 bits... possible cause: 64-bit or gcc 4 (gcc 3 is used on 32-bit hosts. *).
Then we can remove the inline in the definition of the CPP function.
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