Modmodding Q&A Thread

Yeah. Most of them are warnings anyway.
 
Yeah. Most of them are warnings anyway.

I tried compiling in release mode and it still failed. Here are the errors (I won't show the warnings this time):

Code:
Error	14	error C1010: unexpected end of file while looking for precompiled header directive	C:\Users\Philip\Documents\Visual Studio 2010\Projects\CvGameCoreDLL\dllmain.cpp	39
Error	18	error MSB3073: The command "nmake /NOLOGO /K Release" exited with code 1.	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets	38
	19	IntelliSense: cannot open source file "boost/python/tuple.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cycity.h	11
	20	IntelliSense: name followed by '::' must be a class or namespace name	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cycity.h	12
	21	IntelliSense: name followed by '::' must be a class or namespace name	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cycity.h	536
	22	IntelliSense: name followed by '::' must be a class or namespace name	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cycity.h	537
	23	IntelliSense: cannot open source file "boost/python/object.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvdllpythonifacebase.h	13
	24	IntelliSense: name followed by '::' must be a class or namespace name	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvdllpythonifacebase.h	14
	25	IntelliSense: identifier "PyObject" is undefined	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvdllpythonifacebase.h	32
	26	IntelliSense: cannot open source file "boost/python/list.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	160
	27	IntelliSense: cannot open source file "boost/python/tuple.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	161
	28	IntelliSense: cannot open source file "boost/python/class.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	162
	29	IntelliSense: cannot open source file "boost/python/manage_new_object.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	163
	30	IntelliSense: cannot open source file "boost/python/return_value_policy.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	164
	31	IntelliSense: cannot open source file "boost/python/object.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	165
	32	IntelliSense: cannot open source file "boost/python/def.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	166
	33	IntelliSense: name followed by '::' must be a class or namespace name	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	168

Most of them have to do with "Boost/Python". The computer claims that it can't open the C:\...\Beyond the Sword\Mods\RFC Dawn of Alternate History\CvGameCoreDLL\Boost-1.32.0\include\boost\pythonfiles and it doesn't recognize them as a class or namespace name. Did your builds succeed? None of the errors are caused by my mistakes in coding, I don't think.
 
Some of these are maybe the reason for rare bugs or even crashes, I'll investigate this soon.

But most warnings are stuff like declared, but never used variables, which doesn't really matter.
 
The build failed, however, The only big file that I have in release is a precompiled header that is 37,000 kb. Is that what I use for the mod? I remember the DLL file as being roughly 10,000 kb.
 
What does the build failure message say?
 
Well, here's the build message:
Spoiler :
Code:
1>------ Build started: Project: CvGameCoreDLL, Configuration: Release Win32 ------
1>  	"C:\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:\Microsoft Visual C++ Toolkit 2003/include" /I"C:\WindowsSDK/Include" /I"C:\WindowsSDK/Include/mfc" /I"C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\CvGameCoreDLL\Boost-1.32.0/include" /I"C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\CvGameCoreDLL\Python24/include" /FoRelease\dllmain.obj /c dllmain.cpp
1>  dllmain.cpp
1>dllmain.cpp(39): fatal error C1010: unexpected end of file while looking for precompiled header directive
1>NMAKE : warning U4010: 'Release\dllmain.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.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

And here are the errors:

Spoiler :
Code:
Error	1	error C1010: unexpected end of file while looking for precompiled header directive	C:\Users\Philip\Documents\Visual Studio 2010\Projects\CvGameCoreDLL\dllmain.cpp	39
Error	5	error MSB3073: The command "nmake /NOLOGO /K Release" exited with code 1.	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets	38
	12	IntelliSense: cannot open source file "boost/python/list.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	160
	13	IntelliSense: cannot open source file "boost/python/tuple.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	161
	14	IntelliSense: cannot open source file "boost/python/class.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	162
	15	IntelliSense: cannot open source file "boost/python/manage_new_object.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	163
	16	IntelliSense: cannot open source file "boost/python/return_value_policy.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	164
	17	IntelliSense: cannot open source file "boost/python/object.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	165
	18	IntelliSense: cannot open source file "boost/python/def.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	166
	19	IntelliSense: name followed by '::' must be a class or namespace name	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	168
	20	IntelliSense: cannot open source file "boost/python/tuple.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cycity.h	11
	21	IntelliSense: name followed by '::' must be a class or namespace name	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cycity.h	12
	22	IntelliSense: name followed by '::' must be a class or namespace name	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cycity.h	536
	23	IntelliSense: name followed by '::' must be a class or namespace name	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cycity.h	537
	24	IntelliSense: cannot open source file "boost/python/object.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvdllpythonifacebase.h	13
	25	IntelliSense: name followed by '::' must be a class or namespace name	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvdllpythonifacebase.h	14
	26	IntelliSense: identifier "PyObject" is undefined	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvdllpythonifacebase.h	32

Have you had any of these problems? I might have misplaced the Boost Python files...
 
Yeah, you can place the Boost and Python folders right in the CvGameCoreDLL folder.

What is dllmain.cpp?
 
Yeah, you can place the Boost and Python folders right in the CvGameCoreDLL folder.

What is dllmain.cpp?

I have no idea.
 
Is it listed in your makefile (ctrl + f)? If so, remove it.
 
It wasn't there. Did you include all of the DLL files in the DoC DLL folder, or only the ones you changed?
 
No, everything required to build the DLL is in the folder. I've just seen that the Boost and Python folders are included in the SVN as well.

And I've realized that I'm also using Debug as a target so that isn't the reason either.
 
So have you been able to successfully build the DLL whenever you make an SVN commit?
 
Yeah.
 
So where do you think the errors came from?

Here are all 17 errors that I'm having, sorted by the area of occurence. I did not edit any of these files, strangely enough.

The first area is:
Spoiler :

Code:
Error	15	error C1010: unexpected end of file while looking for precompiled header directive	C:\Users\Philip\Documents\Visual Studio 2010\Projects\CvGameCoreDLL\dllmain.cpp	39
Here's the file.
Spoiler :
Code:
/* Replace "dll.h" with the name of your header */
#include "dll.h"
#include <windows.h>

DllClass::DllClass()
{

}


DllClass::~DllClass ()
{

}


BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                       DWORD reason        /* Reason this function is being called. */ ,
                       LPVOID reserved     /* Not used. */ )
{
    switch (reason)
    {
      case DLL_PROCESS_ATTACH:
        break;

      case DLL_PROCESS_DETACH:
        break;

      case DLL_THREAD_ATTACH:
        break;

      case DLL_THREAD_DETACH:
        break;
    }

    /* Returns TRUE on success, FALSE on failure */
    return TRUE;
[COLOR="Red"]}[/COLOR]
That is where the problem is shown in the debug. What does this mean?


Second area:
Spoiler :

Spoiler :
Code:
	27	IntelliSense: cannot open source file "boost/python/list.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	160
	28	IntelliSense: cannot open source file "boost/python/tuple.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	161
	29	IntelliSense: cannot open source file "boost/python/class.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	162
	30	IntelliSense: cannot open source file "boost/python/manage_new_object.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	163
	31	IntelliSense: cannot open source file "boost/python/return_value_policy.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	164
	32	IntelliSense: cannot open source file "boost/python/object.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	165
	33	IntelliSense: cannot open source file "boost/python/def.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	166
	34	IntelliSense: name followed by '::' must be a class or namespace name	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	168
Here's the section of the code where the errors happen:
Spoiler :
Code:
//
// Boost Python
//
#include <boost/python/list.hpp>
#include <boost/python/tuple.hpp>
#include <boost/python/class.hpp>
#include <boost/python/manage_new_object.hpp>
#include <boost/python/return_value_policy.hpp>
#include <boost/python/object.hpp>
#include <boost/python/def.hpp>

namespace python = boost::python;

Third area:
Spoiler :
Spoiler :
Code:
	22	IntelliSense: cannot open source file "boost/python/return_value_policy.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	164
	23	IntelliSense: cannot open source file "boost/python/object.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	165
	24	IntelliSense: cannot open source file "boost/python/def.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	166
	25	IntelliSense: name followed by '::' must be a class or namespace name	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cvgamecoredll.h	168
Code areas:
Spoiler :
Code:
#include <boost/python/tuple.hpp>
namespace python = boost::python;
...
	void setWallOverridePoints(const python::tuple& kPoints); /* points are given in world space ... i.e. PlotXToPointX, etc */
	python::tuple getWallOverridePoints() const;

4th area:
Spoiler :
Spoiler :
Code:
	26	IntelliSense: cannot open source file "boost/python/tuple.hpp"	c:\users\philip\documents\visual studio 2010\projects\cvgamecoredll\cycity.h	11

Spoiler :
Code:
virtual PyObject* MakeFunctionArgs(void** args, int argc) = 0;

5th:
Spoiler :
Spoiler :
Code:
Error	15	error MSB3073: The command "nmake /NOLOGO /K Release" exited with code 1.	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets	38
Spoiler :
Code:
  <Target Name="Build" DependsOnTargets="PrepareForNMakeBuild;ResolveReferences;GetTargetPath" Returns="$(NMakeManagedOutput)">
    <VCMessage Code="MSB8005" Type="Warning" Arguments="NMakeBuildCommandLine" Condition="'$(NMakeBuildCommandLine)'==''"/>
    <Exec Command="$(NMakeBuildCommandLine)"  Condition="'$(NMakeBuildCommandLine)'!=''"/>
  </Target>

If you want me to, I can also show the warnings and message that I have gotten.

Do you understand any of these? I think the only possible problem at this point that I could have made is that I misplaced a folder or screwed up the Makefile.

If all else fails, I could restart from scratch...
 
Can you post the makefile?

(I'll be able to help you more when I have my own source code, which will be next year.)
 
I couldn't upload the physical makefile so I copy-pasted it onto a text document.
 

Attachments

Can't find anything wrong with that. What happens if you use mine (paths changed to your mod's directory of course)?
 
You don't have a CivInstall path?
 
You don't have a CivInstall path?
Even yours is only referenced in the GLOBALPYTHON, GLOBALBOOST (which I don't have) and YOURMOD variables. And I've just used the whole path for the latter.
 
Have you looked at my save already? It's two weeks later! :old:
 
Back
Top Bottom