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]

Re: Link Failure with 3rd party Windows DLLs


Anthony Tuininga wrote:

> I looked at the mailing list archive and noticed that one other person
>
> got this result and had queried the list but I haven't seen a response
>
> to date. Perhaps this information will make it easier to track down
> the
> problem and suggest a solution -- I am a programmer by trade and so do
>
> not necessarily have a problem with making the fix myself. Note that I
>
> am not a compiler/linker programmer, however. :-)
>
> I compiled and linked successfully a C program (one of Oracle's OCI
> demo
> programs) against the OCIW32.LIB (Oracle Call Interface library) which
>
> contains pointers to the OCIW32.DLL and I got the following result
> when
> I tried to run the program:
>

You may have to make the import library yourself.  First you will need a
list of all the functions in the DLL.If they are stdcall functions make
sure they have the @n on them.  Place all this in a DEF file.

for example(I have no what functions OCIW32.DLL exports)

EXPORTS
ociInitialize@4
ociUninitilize@0

This may generate the def file. ociw32.lib is the LIB you have now not
the one you will be creating to use with GCC.

echo EXPORTS > OCIW32.def
nm  ociw32.lib | egrep '^........ [T] _' | sed 's/[^_]*_//' >>
OCIW32.def

Use the following command line to generate the import library.

dlltool --output-lib OCIW32.a --dllname OCIW32.dll --def OCIW32.def -k

-k is to remove @n in the exported names.  It will remove static and
runtime linking errors.  I have had this problem too and the above
solution worked on setupapi.dll.  In this case the import library that
you would use to link with your program is ociw32.a.  OCIW32.LIB must be
a MSVC++ LIB.

Hope this helps

Eric Britten

> The procedure entry point  could not be found in the dynamic link
> library OCIW32.DLL.
>
> Using nm and the link I noticed that the call points are null in the
> library OCIW32.LIB which seems the root cause of the problem (or is
> this
> normal?). Trying nm on the DLL itself simply says "no symbols".
>
> Any pointers at all are appreciated! I really like the GCC/G++
> compilers
> and have used them extensively over the past five years -- this port
> to
> Windows NT will really make life a lot easier for me!
>
> Anthony

-
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]