1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Modmodding Q&A Thread

Discussion in 'Rhye's and Fall - Dawn of Civilization' started by Leoreth, Dec 14, 2013.

  1. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,961
    Gender:
    Male
    Location:
    House of Hades
    Yeah. Most of them are warnings anyway.
     
  2. mrrandomplayer

    mrrandomplayer Hopeless Situation Warrior

    Joined:
    Aug 1, 2012
    Messages:
    3,320
    Gender:
    Male
    Location:
    The land of prequel memes
    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.
     
  3. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,961
    Gender:
    Male
    Location:
    House of Hades
    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.
     
  4. mrrandomplayer

    mrrandomplayer Hopeless Situation Warrior

    Joined:
    Aug 1, 2012
    Messages:
    3,320
    Gender:
    Male
    Location:
    The land of prequel memes
    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.
     
  5. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,961
    Gender:
    Male
    Location:
    House of Hades
    What does the build failure message say?
     
  6. mrrandomplayer

    mrrandomplayer Hopeless Situation Warrior

    Joined:
    Aug 1, 2012
    Messages:
    3,320
    Gender:
    Male
    Location:
    The land of prequel memes
    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...
     
  7. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,961
    Gender:
    Male
    Location:
    House of Hades
    Yeah, you can place the Boost and Python folders right in the CvGameCoreDLL folder.

    What is dllmain.cpp?
     
  8. mrrandomplayer

    mrrandomplayer Hopeless Situation Warrior

    Joined:
    Aug 1, 2012
    Messages:
    3,320
    Gender:
    Male
    Location:
    The land of prequel memes
    I have no idea.
     
  9. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,961
    Gender:
    Male
    Location:
    House of Hades
    Is it listed in your makefile (ctrl + f)? If so, remove it.
     
  10. mrrandomplayer

    mrrandomplayer Hopeless Situation Warrior

    Joined:
    Aug 1, 2012
    Messages:
    3,320
    Gender:
    Male
    Location:
    The land of prequel memes
    It wasn't there. Did you include all of the DLL files in the DoC DLL folder, or only the ones you changed?
     
  11. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,961
    Gender:
    Male
    Location:
    House of Hades
    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.
     
  12. mrrandomplayer

    mrrandomplayer Hopeless Situation Warrior

    Joined:
    Aug 1, 2012
    Messages:
    3,320
    Gender:
    Male
    Location:
    The land of prequel memes
    So have you been able to successfully build the DLL whenever you make an SVN commit?
     
  13. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,961
    Gender:
    Male
    Location:
    House of Hades
    Yeah.
     
  14. mrrandomplayer

    mrrandomplayer Hopeless Situation Warrior

    Joined:
    Aug 1, 2012
    Messages:
    3,320
    Gender:
    Male
    Location:
    The land of prequel memes
    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...
     
  15. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,961
    Gender:
    Male
    Location:
    House of Hades
    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.)
     
  16. mrrandomplayer

    mrrandomplayer Hopeless Situation Warrior

    Joined:
    Aug 1, 2012
    Messages:
    3,320
    Gender:
    Male
    Location:
    The land of prequel memes
    I couldn't upload the physical makefile so I copy-pasted it onto a text document.
     

    Attached Files:

  17. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,961
    Gender:
    Male
    Location:
    House of Hades
    Can't find anything wrong with that. What happens if you use mine (paths changed to your mod's directory of course)?
     
  18. mrrandomplayer

    mrrandomplayer Hopeless Situation Warrior

    Joined:
    Aug 1, 2012
    Messages:
    3,320
    Gender:
    Male
    Location:
    The land of prequel memes
    You don't have a CivInstall path?
     
  19. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,961
    Gender:
    Male
    Location:
    House of Hades
    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.
     
  20. Mouthwash

    Mouthwash Escaped Lunatic

    Joined:
    Sep 26, 2011
    Messages:
    9,368
    Location:
    Hiding
    Have you looked at my save already? It's two weeks later! :old:
     

Share This Page