- If DLL is built in Debug mode, the DLL is loadable and works fine.
- If DLL is built in Release mode, the DLL appears to build perfectly just as in Debug mode, but the created DLL won't load with a win32 LoadLibrary call.
I've gone over the project settings making sure that the Debug settings are similar to the Release settings (except for example DEBUG vs NDEBUG symbol definitions). No help.
If I run dumpbin /exports on the DLLs, I see:
Debug DLL (loads fine):
C:\...>dumpbin /exports arbrslink.dll
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file arbrslink.dll
File Type: DLL
Section contains the following exports for ArbRSLink.dll
00000000 characteristics
4A035B04 time date stamp Thu May 07 17:04:52 2009
0.00 version
1 ordinal base
3 number of functions
3 number of names
ordinal hint RVA name
1 0 00103209 LinkEnd = @ILT+16900(?LinkEnd@@YGKXZ)
2 1 0010A018 LinkStart = @ILT+45075(?LinkStart@@YGKK@Z)
3 2 001036D2 SetCommLink = @ILT+18125(?SetCommLink@@YGKPAXK@Z)
Summary
1C000 .data
1000 .didat
6000 .idata
57000 .rdata
18000 .reloc
6000 .rsrc
21A000 .text
FE000 .textbss
Release DLL (won't load):
C:\...>dumpbin /exports arbrslink.dll
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file arbrslink.dll
File Type: DLL
Section contains the following exports for ArbRSLink.dll
00000000 characteristics
4A0356AA time date stamp Thu May 07 16:46:18 2009
0.00 version
1 ordinal base
3 number of functions
3 number of names
ordinal hint RVA name
1 0 000023F0 LinkEnd = ?LinkEnd@@YGKXZ (unsigned long __stdcall Lin
kEnd(void))
2 1 000062F0 LinkStart = ?LinkStart@@YGKK@Z (unsigned long __stdcal
l LinkStart(unsigned long))
3 2 00001250 SetCommLink = ?SetCommLink@@YGKPAXK@Z (unsigned long _
_stdcall SetCommLink(void *,unsigned long))
Summary
16000 .data
E000 .rdata
9000 .reloc
4000 .rsrc
4D000 .text
I notice the symbol names in the 2nd dump look different, but I'm not sure what to make of it. LoadLibrary+GetLastError returns a bizzare error code 3221225501 when loading the release DLL.
Suggestions appreciated!