Building a Win32 DLL using g++.

Ben Miller Ben.Miller@Mercia.Com
Thu Mar 8 08:35:00 GMT 2001


Hi all,

I've recently started using the cygwin GCC implementation and I'm
having problems trying to create a Win32 DLL.  I created a DLL and
exported a single function using __declspec(dllexport).  My source
file is called cimp.cc and has only the function definition in it.

I tried executing the following (after compiling using 'g++ -c
cimpl.cc'):

dlltool -l cimpl.lib cimpl.obj

ld -Map cimpl.map -e 0 -E -o cimpl.dll cimpl.lib

The problem is that although the .lib file appears to have my
(decorated) function name in it, the generated .dll file does not.
I'm not really that clear on the full abilities of the dlltool and ld
tools, so I'm probably using them wrong.  Do I even need to use ld?
By it's name dlltool sounds like it ought to do th job!

Also, can you tell me if I specifying the entry point correctly (using
'-e 0')?  If I don't use this, dlltool seems to think that I want to
build a .exe file and subsequently fails looking for WinMain.  Is
using a value of zero going to work (I have not DllMain specified in
my code)?

Best regards,
Ben Miller


Mercia Software Ltd.
Mercia House 
Ashted Lock
Aston Science Park
Birmingham B7 4AZ, UK 
Registered Number: 1868855 (Cardiff) 
Tel: 44 (0)121 359 5096 
Fax: 44 (0)121 359 0375 
Web Site: http://www.mercia.com 




--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list