Is it possible to generate a DLL using Turbo C/C++ compiler?
I need this for calling a C function from Java class (JNI)开发者_运维技巧 and I know that there are options to do this using "Microsoft Visual C++ compiler". (explained here)
But I am interested to know if something similar can be done using TC or TCC.
I don't have a copy of "Microsoft Visual C++" and not sure if cl.exe is available without having to install "Microsoft Visual studio"
Short answer: TC is perfectly capable to create a DLL.
Long answer: Turbo C++ is very old. The JNI include files might be using some language features not supported by TC. You might have better luck using another free compiler, for example Visual C++ 2008 Express.
MinGW is a free port of gcc. Great alternative to VS. Here is a tutorial on how to build jni libraries. TC is too old.
cl.exe
is available without the full Visual Studio IDE. The 'Express' install for Visual Studio C++ has an option to install only the command line tools (handy for build machines).
Of course, you can install the IDE, too. You'll get the command line tools in that installation as well.
Finally, the Windows Driver Kit (WDK) comes with a command line compiler.
Also, the Turbo C/C++ you linked to is from 1991 - I'm not sure if it can generate DLLs, but it almost certainly can't generate a Win32 DLL (I'd guess that the best if can do is a Win16 DLL). I wouldn't use it for anything except curiosity/nostalgia. I'd consider it a miracle if it could do anything with JNI.
Yes I agree with DR. You will be much better off using one for MS's free tools (Visaul C++ Express) Just create a library project, code away and then compile it down to a DLL.
Cheers
Yes its possible
I have written a simple tutorial for implementing a "Hello World" program using "Borland Turbo C++" and JDK 1.5
Check it out - here
精彩评论