View Full Version : Help with merge: "error LNK2019: unresolved external symbol"


psyllogism
Nov 16, 2008, 07:45 AM
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 (http://forums.civfanatics.com/showthread.php?t=166933) 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:

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@@p ython@boost@@@Z)
referenced in function "void __cdecl DLLPublishToPython(void)" (?DLLPublishToPython@@YAXXZ)

Any hints to what could be going on? Thanks in advance.

jdog5000
Nov 19, 2008, 11:51 PM
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!

psyllogism
Nov 21, 2008, 07:53 PM
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!

jdog5000
Nov 22, 2008, 12:34 AM
You're welcome! Those kinds of annoyances can be a major pain, but learning how to work with the SDK is well worth it IMO.

ripple01
Nov 26, 2008, 08:25 AM
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

jdog5000
Nov 30, 2008, 11:53 AM
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.

ripple01
Nov 30, 2008, 11:59 AM
Oops, I forgot to mention I sorted this. I missed a step needed during configuring CodeBlocks. It wasn't related to this issue AFAIK, it may have just been a coincidence that it pooped out on this file.

Cheers,
ripple01