This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

DLL without import library?


Is it possible to skip the step of linking a DLL's import library with the
final executable?

I've been trying to avoid using VC++ for Java JNI development.  However, VC++
works great for generating Java-compatible DLL's, and gcc doesn't (or I can't
figure out the trick).

Sun's JNI tutorial, at
http://java.sun.com/docs/books/tutorial/native1.1/stepbystep/ , apparently
relies on the VC++-specific keyword  __declspec(dllexport)  to export
functions from the DLL.  When java.exe interprets my Java program, it finds
the VC++ DLL on my path, loads it, and happily accesses the exported
functions.

If I comment-out the VC++-specific code and compile with gcc, running my Java
program gives me a dialog box saying:

    "The application or DLL E:\java\HelloWorld\hello.dll is not a
    valid Windows NT image.  Please check this against your
    installation diskette."

I am not stripping the DLL or anything fancy -- just following the tutorial
example.  Am I supposed to be able to augment executables just by throwing
DLLs on the path, or would recompiling java.exe be required?

--Andrew Mickish
  http://www.andrew.cmu.edu/~am2q/


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]