I am trying to migrate my existing engine's DLL code to use some DarkGDK functions.
I've tried creating the dll with Entry point of DllMain(....) because my DLL performs some internal setups. This, of course, did not work.
So then I tried using the Constructor()/Destructor()/ReceiveCoreDataPtr() functions as the Help file suggests.
Again, this don't work.
I have a slew of problems that arise - especially in DEBUG build mode.
The following code snippet shows the errors I'm getting in DEBUG build.
1>Linking...
1>core.lib(DBDLLCore.obj) : error LNK2005: _DllMain@12 already defined in WildFireGUILibrary.obj
1>basic3D.lib(CommonC.obj) : error LNK2005: "void __cdecl Destructor(void)" (?Destructor@@YAXXZ) already defined in WildFireGUILibrary.obj
1> Creating library Debug\WFGUIControlsD.lib and object Debug\WFGUIControlsD.exp
1>system.lib(dxdiaginfo.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>convx.lib(ConvX.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>convmd3.lib(ConvMD3.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>convmdl.lib(ConvMDL.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>basic3D.lib(ProcessHSR.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>world.lib(Patch.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>multiplayer.lib(CNetwork.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>system.lib(CSystemC.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>basic3D.lib(NVMeshMenderD3DX.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>basic3D.lib(CBSPTree.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>basic3D.lib(CSG.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>basic3D.lib(CCompiler.obj) : error LNK2019: unresolved external symbol __invalid_parameter_noinfo referenced in function "public: void __thiscall cCompiler::Release(void)" (?Release@cCompiler@@QAEXXZ)
1>display.lib(CGfxC.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>basic3D.lib(DBOFormat.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>basic3D.lib(Universe.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>basic3D.lib(cLightMaps.obj) : error LNK2001: unresolved external symbol __invalid_parameter_noinfo
1>Debug\WFGUIControlsD.dll : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://d:\WildFire GUI\WildFire GUI\Debug\BuildLog.htm"
1>WildFire GUI - 19 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Here is my command line for the compiler and linker (DEBUG):
compiler:
/Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "WILDFIREGUI_EXPORTS" /D "WFGN_BUILD_WILDFIRE" /D "_WINDLL" /Gm /EHsc /MTd /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt
linker:
/OUT:"Debug\WFGUIControlsD.dll" /INCREMENTAL /NOLOGO /DLL /MANIFEST /MANIFESTFILE:"Debug\WFGUIControlsD.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /NODEFAULTLIB:"libc.lib" /NODEFAULTLIB:"libcmt.lib" /NODEFAULTLIB:"msvcrt.lib" /NODEFAULTLIB:"libcd.lib" /NODEFAULTLIB:"msvcrtd.lib" /DEBUG /PDB:"d:\WildFire GUI\WildFire GUI\Debug\WFGUIControlsD.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
And this code snippet shows the errors I'm getting in RELEASE build.
1>Linking...
1>core.lib(DBDLLCore.obj) : error LNK2005: _DllMain@12 already defined in WildFireGUILibrary.obj
1>basic3D.lib(CommonC.obj) : error LNK2005: "void __cdecl Destructor(void)" (?Destructor@@YAXXZ) already defined in WildFireGUILibrary.obj
1> Creating library Release\WFGUIControls.lib and object Release\WFGUIControls.exp
1>Release\WFGUIControls.dll : fatal error LNK1169: one or more multiply defined symbols found
1>Build log was saved at "file://d:\WildFire GUI\WildFire GUI\Release\BuildLog.htm"
1>WildFire GUI - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Here is my Command Line for the Compiler and Linker (RELEASE):
Compiler:
/D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "WILDFIREGUI_EXPORTS" /D "WFGN_BUILD_WILDFIRE" /D "_WINDLL" /FD /EHsc /MT /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /nologo /c /Zi /TP /errorReport:prompt
linker:
/OUT:"Release\WFGUIControls.dll" /INCREMENTAL:NO /NOLOGO /DLL /MANIFEST /MANIFESTFILE:"Release\WFGUIControls.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /NODEFAULTLIB:"libc.lib" /NODEFAULTLIB:"msvcrt.lib" /NODEFAULTLIB:"libcd.lib" /NODEFAULTLIB:"libcmtd.lib" /NODEFAULTLIB:"msvcrtd.lib" /DEBUG /PDB:"d:\WildFire GUI\WildFire GUI\Release\WFGUIControls.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
Now, I've done research and found that you can not include Debug and Non-Debug Runtimes in a dll unless the non-debug version is provided by a dll. All I seem to have are static .lib files - no dll's at all for Dark GDK. Does that sound right? If I've got them somewhere, where would they be (and what are the names).
If I don't - I've done file searches for .DLL equivalents of the .lib files that GDK is using via #pragma comment (lib) - how do I get ahold of the Debug version of the static libs?
I realize that usually source code is required to assist in such matters; however, the size of this engine is 40-some Source files and 50-some Headers. Not something we'd want posted in a forum...
Can somebody please try to give me some direction in this matter?
Regards,
JHeikkilaJr
P.S. - I'd like to also point out that I considered placing this post in the DLL forum, but that appears to be primarily BASIC support (not C++).
P.S.S. - I'd also like to mention that I looked into DBPPluginSDK; but that won't work for me as I don't have the DLL files - at least not the one he's using...
Thanks again.