Weird error when building a debug DLL

NotSoGood

Emperor
Joined
Jan 25, 2009
Messages
1,077
Location
Finland
I had added two new promotion tags to my mod, and succesfully added them to SDK too. Atleast I though so, because they did what I wanted. But now recently the mod has started to crash constantly. It crashes at the start when it loads the promotion infos. But then I tried doing like EmperorFool said here. That was new to me. I had never did so, so I though lets give it a try. But when almost finished VS stops and I get this:
Code:
...
1>CyMapGenerator.cpp
1> "C:/Program Files/Microsoft Visual C++ Toolkit 2003/bin/cl.exe" /nologo  /MD /GR /Od /W3 /EHsc /DWIN32 /D_DEBUG /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /nologo /Zi /Gd /TP   /IBoost-1.32.0/include /IPython24/include /I"C:/Program Files/Microsoft Visual C++ Toolkit 2003/include" /I"C:/Program Files/Microsoft SDKs/Windows/v6.0A/Include" /c CyMapGeneratorInterface.cpp /FoDebug/CyMapGeneratorInterface.obj
1>CyMapGeneratorInterface.cpp
1> "C:/Program Files/Microsoft Visual C++ Toolkit 2003/bin/cl.exe" /nologo  /MD /GR /Od /W3 /EHsc /DWIN32 /D_DEBUG /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /nologo /Zi /Gd /TP   /IBoost-1.32.0/include /IPython24/include /I"C:/Program Files/Microsoft Visual C++ Toolkit 2003/include" /I"C:/Program Files/Microsoft SDKs/Windows/v6.0A/Include" /c CyMapInterface.cpp /FoDebug/CyMapInterface.obj
1>CyMapInterface.cpp
1>Boost-1.32.0\include\boost\tuple\detail\tuple_basic.hpp(338) : fatal error C1067: compiler limit : debug information module size exceeded
1>NMAKE : fatal error U1077: '"C:/Program Files/Microsoft Visual C++ Toolkit 2003/bin/cl.exe"' : return code '0x2'
1>Stop.
1>Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"
1>Build log was saved at "file://d:\CvGameCoreDLL\Debug\BuildLog.htm"
1>CvGameCoreDLL - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
What on earth does that mean?
 
I see two causes for this error in Googling: 1) a very large enum (thousands of values) and 2) very large classes. How much have you added in your mod? The problem is that the PDB file which stores all the debugging information (names of variables, classes, files, etc) has a fairly low limit under VC++ 2003. But there are other very large mods out there that can do debug builds. What exactly have you added to your mod? What is the starting point?
 
I have added better BTS AI, ranged bombard and some my own adds (two promotion tags and a dawn of man fix). I don't think that's so much. Could it depend on the computer?

EDIT: Actually I'm using VC++2008 not VC++ 2003 or perhaps I missed something? Could you explain little more, I'm not too familiar with programming.
 
I think you need to split of the Interface file. I think BTS also has some interface files split of, for example the globalcontext ones.
 
You can use Visual Studio 200<whatever> to edit the source files and kick off the build (F7), but it must be Visual C++ Toolkit 2003 that does the compilation. What tutorial did you follow to setup the SDK? It should have used a makefile that uses VC++.

Splitting the interface means breaking up a header (.h) file so that it's two or more smaller files. For example, CvCityGlobalContext1.h and CvCityGlobalContext2.h. I thought only the .cpp files were broken apart that way, but I honestly never looked very closely at it.

The compiler stores debugging information associated with each interface (.h), and each interface's entry in that database cannot exceed a certain size. By splitting a large one, you make two smaller entries, avoiding that error.
 
You can use Visual Studio 200<whatever> to edit the source files and kick off the build (F7), but it must be Visual C++ Toolkit 2003 that does the compilation. What tutorial did you follow to setup the SDK? It should have used a makefile that uses VC++.
Ah, okay. I didn't know that. I used refar's so yes I have the makefile.

Splitting the interface means breaking up a header (.h) file so that it's two or more smaller files. For example, CvCityGlobalContext1.h and CvCityGlobalContext2.h. I thought only the .cpp files were broken apart that way, but I honestly never looked very closely at it.
So are you saying that I should break a header file into two or more? Do I have to break up the cpp file too and which one of them should I choose?

The compiler stores debugging information associated with each interface (.h), and each interface's entry in that database cannot exceed a certain size. By splitting a large one, you make two smaller entries, avoiding that error.
Do you know what is the size limit?
 
I don't know the limit, but Google would be how I'd find out (hint hint ;)). I don't think knowing the limit would help, though.

I would expect the limit to be attached to the source (.cpp) file myself, but I don't know for sure. To break one up, just make sure that any .cpp or .h file that #includes the original header file now includes both header files. You don't have to split the .cpp, but I think that's the one causing the problem. Try the header alone first I guess.

The main problem is that I don't even know if that file that's mentioned in the error is the actual cause. It may be an overall size limit and not per-file that's failing. Only way to know is to try, though.
 
You suggested to test the file that's mentioned in the error. It's CyMapInterface.cpp.
Its header files
Code:
#include "CvGameCoreDLL.h"
#include "CyMap.h"
#include "CyArea.h"
#include "CyCity.h"
#include "CySelectionGroup.h"
#include "CyUnit.h"
#include "CyPlot.h"
:crazyeye:
It seems rather complicated. Do I just pick one of those header files and "split" it?
How do you split a file? (I'm toatally lost here)
 
I recall that this question has been asked and answered multiple times on civfanatics. I recommend the exact google search:

"debug information module size exceeded" site:civfanatics.com

I did not dig into the results but I am sure you will find an answer there. Unless you have added a huge amount of new code, there is no way you should need to split up any existing files.
 
I've seen this error before, back when I was in my early compiling days. It meant that I had forgotton some critical dll when I had set up VS. It took me 4-5 tries to get past it. There is no way he overloaded his python modules, Mine are way bigger than his and I have not had to break any files apart. My final release dll is 5.90 mb, for reference.

I would go through Rafer's guide very very slowly. Another way to test it, would be to download RevDCM's sources. They include a working VS 08 Project file which you can just load up and should compile fine if you have everything set up right. It's a good way to test and see if you have all the dependencies.
 
You suggested to test the file that's mentioned in the error. It's CyMapInterface.cpp.
Its header files
Code:
#include "CvGameCoreDLL.h"
#include "CyMap.h"
#include "CyArea.h"
#include "CyCity.h"
#include "CySelectionGroup.h"
#include "CyUnit.h"
#include "CyPlot.h"
:crazyeye:
It seems rather complicated. Do I just pick one of those header files and "split" it?
How do you split a file? (I'm toatally lost here)

did you add (or merged) anything to CyMapInterface.cpp? In that case you will most likely have to split this file. You could take a look at the Fall Further Sourcedoce, they did split up the file http://forums.civfanatics.com/showthread.php?t=292532
 
This is the best I could find but it's for code blocks and I can't even use it with VC. Seems like no one has ever had this problem with Visual Studio. I'll try the RevDCM next.

EDIT:
Another way to test it, would be to download RevDCM's sources. They include a working VS 08 Project file which you can just load up and should compile fine if you have everything set up right. It's a good way to test and see if you have all the dependencies.

I downloaded just the RevDCM sources, but there's no projects in it. :confused: Where did you got your's?
 
This is the best I could find but it's for code blocks and I can't even use it with VC. Seems like no one has ever had this problem with Visual Studio. I'll try the RevDCM next.

EDIT:

I downloaded just the RevDCM sources, but there's no projects in it. :confused: Where did you got your's?

Really? That's odd. Fine, I know MY source code has a project file in it, go to the modders guide on my sig and download it from there, second post down. See if it compiles okay.
 
So lets pull things together. I tested your code Afforess and it compiled without errors. So it seems that there's something wrong with my mod. Does anyone have ideas what it might be? I compared the Afforess' code to mine and noticed that there isn't CvGameCoreDLL.rc file in my folder. Is that improtant for the basic code or addons of Afforess? I checked refar's quide:
• Delete the files CvGameCoreDLL.vcproj and CvGameCoreDLL.rc.
:confused::confused:
 
Top Bottom