Search code examples
delphilinker64-bitjava-native-interface

64 bit linking of an object file


I am developing JNI DLL files in Delphi 7. The resulting files will be 32 bit DLLs, which do not work on a 64bit Java VM.

Delphi 7 has the possibility to generate c or c++ object files. Is it possible to create a 64bit DLL from these object files with a third party linker?


Solution

  • The Delphi compiler emits 32 bit object code. It doesn't matter how you slice it, that code cannot be linked into a 64 bit module.

    At the moment your best bet is to use FreePascal which can produce 64 bit DLLs. There is an upcoming 64 bit version of Delphi but its release date is unknown.

    Another option would be to enforce the use of the 32 bit version of the JVM, if that is possible for you.