none
I am trying to create a JNI 64bit DLL with Visual Studio, but it reports "Can't load IA 32-bit .dll on a AMD 64-bit platform"

    Question

  • I am trying to create a JNI 64bit DLL with Visual Studio 2015 Community (while waiting for my company to install the full version). Both the 32-bit and 64-bit JNI DLL are created. The 32 bit DLL works, but when I try to use the 64-bit DLL, it reports ""Can't load IA 32-bit .dll on a AMD 64-bit platform".

     

    The command line compile options from the Configuration:Relase, Platform:64 bit, Project -> Options -> Configuration Properties -> C/C++ -> Command Line shows:

    /GS /W1 /Zc:wchar_t /I"c:\Program Files\Java\jdk1.8.0_101\include" /I"c:\Program Files\Java\jdk1.8.0_101\include/win32" /Zi /Gm- /O2 /Fd"x64\Release\vc140.pdb" /Zc:inline /fp:precise /D "_WINDLL" /errorReport:prompt /WX- /Zc:forScope /Gd /MD /Fa"x64\Release\" /EHsc /nologo /Fo"x64\Release\" /Fp"x64\Release\HelloWorldDllX64.pch"

     

    The command line link options from the Configuration:Relase, Platform:64 bit, Project -> Options -> Configuration Properties -> Linker -> Command Line shows:

    /OUT:"F:\VS\HelloWorldDllX64\x64\Release\HelloWorldDllX64.dll" /MANIFEST /NXCOMPAT /PDB:"F:\VS\HelloWorldDllX64\x64\Release\HelloWorldDllX64.pdb" /DYNAMICBASE "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /IMPLIB:"F:\VS\HelloWorldDllX64\x64\Release\HelloWorldDllX64.lib" /DEBUG /DLL /MACHINE:X64 /PGD:"F:\VS\HelloWorldDllX64\x64\Release\HelloWorldDllX64.pgd" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"x64\Release\HelloWorldDllX64.dll.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64" /TLBID:1

     

    I checked and the 32bit libraries in VS are suppose to also contain the 64bit code.

    The Visual Studio is loaded on a Windows 7 VM on a  Linux box.

     

    Any Ideas? Thanks for any help you can give.

    Thursday, October 13, 2016 2:00 PM

Answers

All replies

  • Hi dcellis,

    Since Our forum is discussing about VS general question like how to set/configure Visual Studio and Visual Studio tools. And for your issue, we don't support cross platform development for JNI.

     I suggest you could try to ask your question there.

    Best Regards,

    Lake Xiao

    Friday, October 14, 2016 7:53 AM
    Moderator
  • Just because I am doing development on Windows VM on a Linux box, does not make this cross platform development. I am developing a JNI application for a Windows 64 bit application on a Window 64 bit system. The only reason I mentioned the Linux host computer was to let you know that I was using a VM and wondered if this might be causing a problem.

    I will ask my question again at your suggested website.

    Monday, October 17, 2016 12:00 PM
  • Figured it out. Operator Error.
    Monday, October 17, 2016 1:39 PM
  • Hi decellis,

    Glad to hear your have solved your issue and thanks for sharing here, if possible, please mark your reply as the answer, so it would be helpful for other members who get the same issue as yours to research and find the answer directly, and I could close this case.

    Have a nice day,

    Best Regards,

    Lake Xiao

    Tuesday, October 18, 2016 12:56 AM
    Moderator