Unresolved external symbol

kipkuhmi

Warlord
Joined
Aug 8, 2007
Messages
131
Hi everyone,

I tried to build my CivGameCoreDLL following Kael's tutorial and using CodeBlocks.

When doing this, I'm getting four "unresolved external symbol" errors (listed below). Now I understand this message as the linker needing some more cpp or h files. But which ones are needed?

E.g., "unresolved external symbol __imp__GetKeyState" sounds like a windows command to me, doesn't it?

Thanks for any help.



###############
...

CyGlobalContextInterface4.cpp
CyHallOfFameInfo.cpp
CyHallOfFameInterface.cpp
CyInfoInterface1.cpp
CyInfoInterface2.cpp
CyInfoInterface3.cpp
CyMap.cpp
CyMapGenerator.cpp
CyMapGeneratorInterface.cpp
CyMapInterface.cpp
CyPlayer.cpp
CyPlayerInterface1.cpp
CyPlayerInterface2.cpp
CyPlot.cpp
CyPlotInterface1.cpp
CyRandomInterface.cpp
CyReplayInfo.cpp
CySelectionGroup.cpp
CySelectionGroupInterface.cpp
CyStructsInterface1.cpp
CyTeam.cpp
CyTeamInterface.cpp
CyUnit.cpp
CyUnitInterface1.cpp
FAssert.cpp
FDialogTemplate.cpp
_precompile.cpp
Linking dynamic library: ..\Beyond the Sword\Assets\CvGameCoreDLL.dll
Creating library ..\Beyond the Sword\Assets\CvGameCoreDLL.lib and object ..\Beyond the Sword\Assets\CvGameCoreDLL.exp
CvDLLWidgetData.obj : error LNK2019: unresolved external symbol __imp__GetKeyState@4 referenced in function "public: void __thiscall CvDLLWidgetData::doResearch(struct CvWidgetDataStruct &)" (?doResearch@CvDLLWidgetData@@QAEXAAUCvWidgetDataStruct@@@Z)
CvGame.obj : error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "public: virtual void __thiscall CvGame::read(class FDataStreamBase *)" (?read@CvGame@@UAEXPAVFDataStreamBase@@@Z)
CvPlayer.obj : error LNK2001: unresolved external symbol __imp__timeGetTime@0
CvGameCoreDLL.obj : error LNK2019: unresolved external symbol __imp__timeEndPeriod@4 referenced in function _DllMain@12
CvGameCoreDLL.obj : error LNK2019: unresolved external symbol __imp__timeBeginPeriod@4 referenced in function _DllMain@12
..\Beyond the Sword\Assets\CvGameCoreDLL.dll : fatal error LNK1120: 4 unresolved externals
Process terminated with status 1 (22 minutes, 17 seconds)
6 errors, 0 warnings

################
 
I should add, I'm running Vista 64 bit. Could this cause the problem? It seems to me it has sth to do with the Windows API.
 
Oh my, this one really drives me insane.

For example, the linker obviously doesn't find "timeGettime", which for all that I know is a winmm.lib command. I've added the folder which contains winmm.lib to the Compiler Settings --> Directories --> Linker list, but still the "unresolved external symbol" message appears.
 
Me again ... :)

I guess I found the solution myself, rather by accident.

In Settings --> Compiler --> Directories --> Linker I had to re-arrange the order of the included lib directories. I guess it really has sth to do with the x64 / x86 versions, and the compiler chose the wrong one. Whatever, the built terminated smoothly now without any further error messages.
 
Back
Top Bottom