Re: Can't Generate Win95 Compatible DLL With VS2005 C++
"John H" <jhowison@radiantsystems.com> wrote in message
news:1164216213.397134.57330@e3g2000cwe.googlegroups.com...
My VS2005 generated, non-managed C++ dll fails to load on Win95. A
0x1f error is reported by Win95.
Depends.exe shows references to two undefined kernel32 entry points,
IsDebuggerPresent and InterlockedCompareExchange. My code does not
reference either of these entrypoints directly. The references
apparently result by virtue of linking to MS libraries included in the
VS2005 distribution.
I have a C++ executable without any reference to InterlockedCompareExchange.
Increment, Decrement, and Compare, but not CompareExchange. I would suspect
boost or your threading library. The compiler provides an intrinsic
definition for those anyway because they're a single prefixed x86
instruction each.
Also, if you provide an object file/library file with a stub definition of
IsDebuggerPresent, the linker should use that instead of the import library.
Just be careful of the order of filenames on the link line. If you want to
be safe, use LoadLibrary to call IsDebuggerPresent when you've got it, but
you pretty much know the result should always be false, so a no-op function
should work too.
I'm at a loss on how to get rid of the references. Any suggestions
will be greatly appreciated.
C/C++ Command line:
/O2 /GL /I "..\Common" /I "..\Threading" /I "..\propertyBag" /I
"..\VboClient" /I "..\RegEx_Lib" /I "..\boost_1_32_0" /D
"_USE_32BIT_TIME_T" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL"
/D "ECARDPOS_EXPORTS" /FD /EHsc /MD /Yu"stdafx.h"
/Fp"Release\eCardPOS.pch" /Fo"Release\\" /Fd"Release\vc80.pdb" /W3
/nologo /c /Wp64 /TP /errorReport:prompt
Linker Command line:
/VERBOSE
/OUT:"C:\eCardG2\FOH\Source\eCard\Future\dotNet\FOH\Release\eCardPOS.dll"
/INCREMENTAL:NO /NOLOGO /LIBPATH:"..\boost_1_32_0\libs" /DLL /MANIFEST
/MANIFESTFILE:"Release\eCardPOS.dll.intermediate.manifest"
/SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /MACHINE:X86
/ERRORREPORT:PROMPT Ws2_32.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
"..\release\regex_lib.lib" "..\vboclient\release\cppclient.lib"
"..\propertybag\release\propertybag.lib"
"..\threading\release\threading.lib" "..\common\release\common.lib"