Help with merge: "error LNK2019: unresolved external symbol"

psyllogism

Chieftain
Joined
Apr 6, 2007
Messages
23
Location
Maryland, USA
Hi,

I'm trying to learn how to mod Civ IV and thought I would start with somebody else's mod and go from there. I downloaded the sources for Revolution 1.65bts, copy/pasted them into a directory with the BTS 3.17 CvGameCoreDLL sources, and followed Kael's instructions to set up CodeBlocks to compile the project.

Previously, I was able to compile the BTS 3.17 sources just fine into my own DLL. However, when I add the Revolution 1.65bts sources and try to compile this new project, I get the following error:

Code:
CvDLLPython.obj : error LNK2019: unresolved external symbol
"void __cdecl CyCityPythonInterface2(class boost::python::class_<class CyCity,struct boost::python::detail::not_specified,struct boost::python::detail::not_specified,struct boost::python::detail::not_specified> &)"
(?CyCityPythonInterface2@@YAXAAV?$class_@VCyCity@@Unot_specified@detail@python@boost@@U2345@U2345@@python@boost@@@Z)
referenced in function "void __cdecl DLLPublishToPython(void)" (?DLLPublishToPython@@YAXXZ)

Any hints to what could be going on? Thanks in advance.
 
The file CyCityPythonInterface2.cpp is one that is added for this mod ... there's a limit to how long the Cy____Interface_.cpp files can be and I needed to overflow.

Anyway, what's happening is that this file is not being built by the compiler. When the linker tries to find the build CyCityPythonInterface2.obj to add the the DLL, it can't cause it doesn't exist. I don't know exactly how Codeblocks works but you need to do one of two things:

Either add CyCityPythonInterface2.cpp to the list of files in the project, or add a reference to CyCityPythonInterface2 in the Makefile for the project in the same way and place as the other city interface file.

Post again if you need more help. Oh, and welcome to the wild world of modding!
 
Upon reflection, I guessed it had to be something like that. But then I had computer troubles and couldn't check it out until now. You were absolutely right! I added CyCityInterface2.cpp to the project and it compiled! Thanks for your attention. I am definitely still learning CodeBlocks (not to mention re-learning C++). If I can just get through minor annoyances like this one, then I'll be well on my way. Thanks again!
 
I am getting a similar error to this, and it is happening on the same file so I think it might be related.

fatal error c1067: compiler limit : debug information module size exceeded

while processing CyCityInterface1.

I added CyCityInterface2 to the CodeBlocks project as stated above, but I still get the error. Anyone else have any suggestions?

Cheers,
ripple01
 
Hope you've figured this out already ... but if not:

Yeah, what you need to do is move some of the definitions from interface1 to interface2 ... you've run into the limit on how long each individual interface file can be. Also, there are a couple of places where you have to make changes to get the second interface file working. Do a search for CyCityInterface and make sure there's a line for 2 matching all the lines for 1.
 
Back
Top Bottom