A simple guide to compiling the DLL

It's been a while since I have tried this and got this to work and now I need help.

I am trying to compile a FfH modmod (Orbis) and can't get it to work. I can compile BtS no problem, but not the Orbis dll. I am using the given makefile with the correct paths and 2008 Express.

I copy over the BtS files and then copy over top the Orbis files.

Any ideas?
 
What are the error messages that you're getting?
 
It's been a while since I have tried this and got this to work and now I need help.

I am trying to compile a FfH modmod (Orbis) and can't get it to work. I can compile BtS no problem, but not the Orbis dll. I am using the given makefile with the correct paths and 2008 Express.

I copy over the BtS files and then copy over top the Orbis files.

Any ideas?

Perhaps Orbis has more cpp/h files which our makefile is not setup to compile.
 
I don't get any error messages. It says it has skipped.

So should I check around about using a different makefile?
 
Anyone have any ideas on this error message?

Capture17.PNG

I'm merging Advanced Diplomacy into Better BAT AI. The DLL compiles fine, but this is what I get when I try to run it in debug. I get a CTD with just the regular DLL.

Thoughts? I thought I had some XML out of place...
 
That is a pointer error and you will need to debug to see where it is thrown.

You can generate a crash dump they you may open with visual studio to see where the error was thrown.
 
Does '1>NMAKE : warning U4011: 'Release' : not all dependents available; target not built' when I try to compile mean that I'm missing a couple of SDK files, or something? New to this, totally lost...
 
Does '1>NMAKE : warning U4011: 'Release' : not all dependents available; target not built' when I try to compile mean that I'm missing a couple of SDK files, or something? New to this, totally lost...

Try with makefile from my mod, just change this:
Code:
TOOLKIT=E:\Microsoft Visual C++ Toolkit 2003
PSDK=C:\Program Files\Microsoft SDKs\Windows\v7.0A
CIVINSTALL=E:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword
to your path.
 

Attachments

  • Makefile.rar
    2.2 KB · Views: 141
Still not working... :(

I'm going to fiddle around with it for a while, see if I can get it working...meanwhile here's the whole error I'm getting:

Code:
1>------ Build started: Project: CvGameCoreDLL, Configuration: Release Win32 ------
1>Build started 7/15/2014 10:19:10 AM.
1>Build:
1>  	""C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003"\bin\cl.exe" /nologo /MD /O2 /Oy /Oi /G7 /DNDEBUG /DFINAL_RELEASE /Fp"Release\CvGameCoreDLL.pch" /GR /Gy /W3 /EHsc /Gd /Gm- /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /Yu"CvGameCoreDLL.h" /IBoost-1.32.0/include /IPython24/include /I""C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003"/include" /I""C:\Program Files\WindowsSDK"/Include" /I""C:\Program Files\WindowsSDK"/Include/mfc" /I""C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword"\CvGameCoreDLL\Boost-1.32.0/include" /I""C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword"\CvGameCoreDLL\Python24/include" /FoRelease\CvUnit.obj /c CvUnit.cpp
1>  The input line is too long.
1>NMAKE : warning U4010: 'Release\CvUnit.obj' : build failed; /K specified, continuing ...
1>NMAKE : warning U4011: 'Release\CvGameCoreDLL.dll' : not all dependents available; target not built
1>NMAKE : warning U4011: 'Release' : not all dependents available; target not built
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "nmake /NOLOGO /K Release" exited with code 1.
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.71
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 
Now I've got a whole ton of those "the input line is too long" things. :confused:

EDIT: aHA. Now I've found it.

Code:
1>  CvUnit.cpp
1>CvUnit.cpp(4654): error C2086: 'CvPlot *pTargetPlot' : redefinition
1>          CvUnit.cpp(4642) : see declaration of 'pTargetPlot'

I'll go take a look and see what I can do.

EDIT 2: Alllllright... now I need some help. The above was talking about these few lines:

Code:
	// Super Forts begin *bombard*
	//FAssertMsg(pBombardCity != NULL, "BombardCity is not assigned a valid value"); - Removed for Super Forts

	CvPlot* pTargetPlot;
	//CvPlot* pTargetPlot = pBombardCity->plot(); - Original Code
	if(pBombardCity != NULL)
	{
		pTargetPlot = pBombardCity->plot();
	}
	else
	{
		pTargetPlot = bombardImprovementTarget(pPlot);
	}
	// Super Forts end

	CvPlot* pTargetPlot = pBombardCity->plot();
	if (!isEnemy(pTargetPlot->getTeam()))
	{
		getGroup()->groupDeclareWar(pTargetPlot, true);
	}

	if (!isEnemy(pTargetPlot->getTeam()))
	{
		return false;
	}

Line 4654 is where it says CvPlot* pTargetPlot = pBombardCity->plot(); .
If I comment that out or remove it I get a whole mess of errors that say things like "error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z)"

If it helps I'm running 64-bit windows 7 with visual studio 2010

Any ideas? :sad:
 
change
CvPlot* pTargetPlot = pBombardCity->plot();
to
pTargetPlot = pBombardCity->plot();
 
Sorry, you should be removing the line 4654 otherwise your code does not make much sense.

The linking error are probably not related to this line. This line prevents it from compiling once you successfully compile you get to the linking step which fails.

So, resolve the link error.
 
Thanks for the help! Now I slightly understand this...how do I resolve a link error? (or, rather, what is a link error...?)
 
"If you receive a linker error, it means that your code compiles fine, but that some function or library that is needed cannot be found. This occurs in what we call the linking stage and will prevent an executable from being generated. "

So, find which function/class/variable that it is unable to find and see if it is implemented somewhere, misspelled or some other problem. Can also be if something is defined twice.

Can be that the code you are supposed to be linking to has not been compiled/failed compilation.
 
All right. Thanks for the help, I really appreciate it. :goodjob:
 
I've followed the instructions but it failed to compile (I haven't changed even any file). Here's the Output Window of BuildLog:
Code:
Performing Makefile project actions
 "C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\cl.exe" /nologo /MD /Zi /Od /D_DEBUG /RTC1 /Fp"Debug\CvGameCoreDLL.pch" /GR /Gy /W3 /EHsc /Gd /Gm- /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /Yu"CvGameCoreDLL.h" /IBoost-1.32.0/include /IPython24/include /I"C:\Program Files\Microsoft Visual C++ Toolkit 2003/include" /I"C:\Program Files\WindowsSDK/Include" /I"C:\Program Files\WindowsSDK/Include/mfc" /I"C:\Users\Igor\Documents\My Games\Beyond the Sword\CvGameCoreDLL\Boost-1.32.0/include" /I"C:\Users\Igor\Documents\My Games\Beyond the Sword\CvGameCoreDLL\Python24/include" /YcCvGameCoreDLL.h /Fo"Debug\_precompile.obj" /c _precompile.cpp
_precompile.cpp
c:\Program Files\CvGameCoreDLL\CvGameCoreDLL.h(160) : fatal error C1083: Cannot open include file: 'boost/python/list.hpp': No such file or directory
NMAKE : warning U4010: 'Debug\CvGameCoreDLL.pch' : build failed; /K specified, continuing ...
 "C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\cl.exe" /nologo /MD /Zi /Od /D_DEBUG /RTC1 /Fp"Debug\CvGameCoreDLL.pch" /GR /Gy /W3 /EHsc /Gd /Gm- /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /Yu"CvGameCoreDLL.h" /IBoost-1.32.0/include /IPython24/include /I"C:\Program Files\Microsoft Visual C++ Toolkit 2003/include" /I"C:\Program Files\WindowsSDK/Include" /I"C:\Program Files\WindowsSDK/Include/mfc" /I"C:\Users\Igor\Documents\My Games\Beyond the Sword\CvGameCoreDLL\Boost-1.32.0/include" /I"C:\Users\Igor\Documents\My Games\Beyond the Sword\CvGameCoreDLL\Python24/include" /FoDebug\CvArea.obj /c CvArea.cpp
CvArea.cpp
CvArea.cpp(3) : fatal error C1083: Cannot open precompiled header file: 'Debug\CvGameCoreDLL.pch': No such file or directory
NMAKE : warning U4010: 'Debug\CvArea.obj' : build failed; /K specified, continuing ...
and something like that for 90000 characters. What have I done wrong?
 
When having problems with a build, fix the first error that comes up first.

The first error you have is "Cannot open include file: 'boost/python/list.hpp': No such file or directory".

What that most likely means is that you have not edited the makefile information correctly (if at all) to point to where your game is actually installed, since that is where the boost stuff is. See step 5 in the first post in this thread - what is probably wrong is your CIVINSTALL setting.

Fixing that one error will probably fix everything.
 
Top Bottom