A study on the JNI interface of Java calling C + + DLL file--distribution function calculation

Source: Internet
Author: User
Tags visual studio 2010

Have done some research on the VS platform running GNU Library and Java call VS2010 x64 bit system, then we will try to generate a DLL that calls the probability statistic function and run it in the Java program. When you are ready to generate a DLL file with a normal distribution function, the following error occurs:

1> Creating library D:\documents\visual Studio 2010\projects\getnrompdf\x64\debug\getnrompdf.lib and Objects D:\documents\visual Stud Io 2010\projects\getnrompdf\x64\debug\getnrompdf.exp

1>getnrompdf.obj:error LNK2019: unresolved external symbol __imp_gsl_ran_gaussian_pdf, the symbol in the function java_cn_dfinder_test_getnormpdf_ Referenced in Normpdf

1>d:\documents\visual Studio 2010\projects\getnrompdf\x64\debug\getnrompdf.dll:fatal Error lnk1120:1 an unresolved external command

1>

1> build failed.

1>

1> used Time 00:00:00.93

========== All rebuilds: 0 successful, 1 failed, 0 ========== skipped

The initial guess is that the lib file misplaced, all the Include files and Lib files are copied one copy, to

It's not going to work.

Join the following dependent libraries

Still no problem solved.

After numerous adjustments confirmed, in the 64-bit compilation environment, the failure

DLL succeeds in a 32-bit compilation environment.

1> Creating library E:\VS2010Projects\GnuDllTest\x64\Debug\GnuDllTest.lib and Objects E:\VS2010Projects\GnuDllTest\x64\Debug\ Gnudlltest.exp

1>gnudlltest.obj:error LNK2019: unresolved external symbol gsl_ran_gaussian_pdf, the symbol in the function java_cn_dfinder_test_getnormpdf_normpdf is referenced in

1>e:\vs2010projects\gnudlltest\x64\debug\gnudlltest.dll:fatal error Lnk1120:1 an unresolved external command

1>

1> build failed.

Suspected to be related to the GNU system's own DLL or LIB version. Need to recompile their version.

Http://www.heybody.com/2013/09/call-32-dll-x86-in-x86-system.html

Kind of like my situation.

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.