GCC Cygwin C++ DLL linking problem

From: Sam Tiny (spam_at_nospam.com)
Date: 03/16/05


Date: Wed, 16 Mar 2005 09:49:12 -0700

I have a Windows LIB/DLL that I need to link my GCC program with. I have
followed all the instructions I could find: using pexports to create .def
file from the .dll and then using dlltool to create a .a library file from
the .def file. I've dumped the symbols from the .a and noticed each function
is appeded with an underscore (_). Note that a dump of the DLL does not have
underscores prefixed to the function names. Also, the .def doesn't have any
underscores prefixed to the function names. I have been completely unable to
link my program when compiled as C++ getting the "undefined reference to"
error for each function in the DLL, but I am able to compile and link as C
code. Any suggestions? Thanks for any help.



Relevant Pages

  • Re: GCC Cygwin C++ DLL linking problem
    ... > or use quote in your code like: ... Also, the .def doesn't have ... >> error for each function in the DLL, but I am able to compile and link as ...
    (comp.lang.cpp)
  • Re: mkmf, linking against a specific DLL on windows
    ... > a .def from a .dll. ... Copyright Microsoft Corporation. ... It's possible to tweak win32/mkexports.rb to accept DLL files ... + case filetype ...
    (comp.lang.ruby)
  • Re: Dll Build
    ... I would use SOURCES to build such a DLL. ... > I am trying to build a class installer dll and I want to use a .def file to ... > the command line utility included with the SDK or the VC++ build enviroment? ... > about how to use a .def file in the VC++ IDE, but was unable to locate the ...
    (microsoft.public.development.device.drivers)
  • Re: Linker Problem
    ... This problem is further compounded if your DLL exports classes - ... you should use a ".def" file that lets you control ... The only reason you would need to relink is if you have made ...
    (microsoft.public.vc.mfc)
  • Re: dll project generates fully .lib
    ... but I want a full static library (reusing any functionality) and ... If the project is dll -type then the ... library contains only the exported symbols from the .def. ...
    (microsoft.public.vstudio.development)

Loading