c++ - SNN.lib error when compiling DLL
- Chris Gleinser (11/11) Apr 04 2007 Hello,
- Walter Bright (2/17) Apr 04 2007 Make sure you're linking with kernel32.lib.
- Chris Gleinser (4/4) Apr 05 2007 Thanks for your reply,
- Bertel Brander (8/13) Apr 05 2007 You need to tell dmc that it hast to link to kernel32.lib when you are
- Chris Gleinser (7/7) Apr 05 2007 Ahh perfect ;) it works now, thanks!
- Walter Bright (3/8) Apr 05 2007 First, check to see if you have codeview symbolic debug info enabled.
- Chris Gleinser (4/4) Apr 09 2007 Well, I didn't use any of the "g" options, so I assume there's no debug ...
- Walter Bright (3/8) Apr 10 2007 There isn't much to it - just a list of global symbols, the modules they...
- Nicholas Jordan (4/4) Mar 05 2009 Like this ( ? ):
Hello, finally I managed to compile a DLL with Microsoft's C++ compiler, but I'd like to use Digital Mars for that. When I use Mars for normal stuff, it's no problem, however, when I try to compile a DLL, I get errors like: C:\(blabla...)\SNN.lib(cinit) Error 42: Symbol Undefined _GetEnvironmentStrings 0 ...and approx. 20 more of those, all of them have issues with the SNN.lib and all of them are Error 42 with some function that can't be resolved. What am I doing wrong? Is there anything I could try? Thanks for your help, Chris
Apr 04 2007
Chris Gleinser wrote:Hello, finally I managed to compile a DLL with Microsoft's C++ compiler, but I'd like to use Digital Mars for that. When I use Mars for normal stuff, it's no problem, however, when I try to compile a DLL, I get errors like: C:\(blabla...)\SNN.lib(cinit) Error 42: Symbol Undefined _GetEnvironmentStrings 0 ...and approx. 20 more of those, all of them have issues with the SNN.lib and all of them are Error 42 with some function that can't be resolved. What am I doing wrong? Is there anything I could try? Thanks for your help, ChrisMake sure you're linking with kernel32.lib.
Apr 04 2007
Thanks for your reply, however, I checked my lib-path and it has got the dm\lib-directory, where kernel32.lib is located, as its very first entry. So I assume the linker should find the lib?
Apr 05 2007
Chris Gleinser skrev:Thanks for your reply, however, I checked my lib-path and it has got the dm\lib-directory, where kernel32.lib is located, as its very first entry. So I assume the linker should find the lib?You need to tell dmc that it hast to link to kernel32.lib when you are building dll's, like: dmc -mn -WD mydll.cpp kernel32.lib -- Just another homepage: http://damb.dk But it's mine - Bertel
Apr 05 2007
Ahh perfect ;) it works now, thanks! But the DLL has double size (400 kb instead of 200), well I'm aware that different compilers produce different output files, but could it be that I dmc included some extra files / libs that are not neccessary and can be omitted somehow? Sorry for those questions but I'm not too experienced with compilers and especially with their direct commandline interfaces...
Apr 05 2007
Chris Gleinser wrote:Ahh perfect ;) it works now, thanks! But the DLL has double size (400 kb instead of 200), well I'm aware that different compilers produce different output files, but could it be that I dmc included some extra files / libs that are not neccessary and can be omitted somehow?First, check to see if you have codeview symbolic debug info enabled. Second, look at the generated .map file to see what is in the dll.
Apr 05 2007
Well, I didn't use any of the "g" options, so I assume there's no debug info in my compiled output - or do I have to look somewhere else? And to be honest, I don't understand the map-file ;) is there any resource where I can find information on how to read the map file?
Apr 09 2007
Chris Gleinser wrote:Well, I didn't use any of the "g" options, so I assume there's no debug info in my compiled output - or do I have to look somewhere else? And to be honest, I don't understand the map-file ;) is there any resource where I can find information on how to read the map file?There isn't much to it - just a list of global symbols, the modules they came from, and their addresses in the resulting executable.
Apr 10 2007
Like this ( ? ): -L/ linker_options.txt -p -GT8 -HDF:\pch -mn -WD -l.zarfListing - HD"C:\Documents and Settings\Owner\My Documents\db\pss\util" - ozarfOCR.dll zarfDLL.c kernel32.lib
Mar 05 2009