Problem compiling SDK for A Better AI...

Spocko

Warlord
Joined
Dec 18, 2005
Messages
170
Location
Kittery, Maine
This code is fantastic - it has truly enhanced gameplay by a significant magnitude.

Nevertheless, I'm having a problem compiling the associated SDK on my machine. I'd like to know what settings I need to make in CodeBlocks in order to compile the source code for Better AI.

I've followed Kael's instructions for setting up CodeBlocks (http://forums.civfanatics.com/showpost.php?p=3922687&postcount=1) and I've followed the instructions herein for pulling down the source code for Better AI (http://forums.civfanatics.com/showpost.php?p=4737311&postcount=127), but when I use CodeBlocks to compile this code, it crashes almost immediately (see below for the Build Log). It seems the most offensive error is "CvGameCoreDLL.h:27:20: hash_map: No such file or directory".

I have successfully compiled the Vanilla/Warlords SDK several times and I have successfully downloaded the full set of source code files for BAI (updated today). Now I'd like to be able to tweak BAI and compile locally.

Any advice?
Thanks!

Code:
Project   : CvGameCoreDLL
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\Owner\My Documents\My Received Files\Civ4 Downloads\SDK\Civ4_SDK_source\Better AI Warlords SDK\CvGameCoreDLL\
--------------------------------------------------------------------------------
Switching to target: Final Release|Win32
Compiling: CvArea.cpp
In file included from CvArea.cpp:3:
CvGameCoreDLL.h:27:20: hash_map: No such file or directory
In file included from CvArea.cpp:3:
CvGameCoreDLL.h:147: error: `__forceinline' does not name a type
CvGameCoreDLL.h:148: error: expected constructor, destructor, or type conversion before "float"
CvGameCoreDLL.h:148: error: expected `,' or `;' before "float"
CvGameCoreDLL.h:149: error: expected constructor, destructor, or type conversion before "float"
CvGameCoreDLL.h:149: error: expected `,' or `;' before "float"
In file included from CvGameCoreDLL.h:167,
                 from CvArea.cpp:3:
FAssert.h:51:20: warning: no newline at end of file
In file included from CvGameCoreDLL.h:171,
                 from CvArea.cpp:3:
FFreeListTrashArray.h: In member function `int FFreeListTrashArray<T>::getNumSlots() const':
FFreeListTrashArray.h:50: error: `m_iNumSlots' undeclared (first use this function)
FFreeListTrashArray.h:50: error: (Each undeclared identifier is reported only once for each function it appears in.)
FFreeListTrashArray.h: In member function `int FFreeListTrashArray<T>::getLastIndex() const':
FFreeListTrashArray.h:55: error: `m_iLastIndex' undeclared (first use this function)
FFreeListTrashArray.h: In member function `void FFreeListTrashArray<T>::setLastIndex(int)':
FFreeListTrashArray.h:59: error: `m_iLastIndex' undeclared (first use this function)
FFreeListTrashArray.h: In member function `int FFreeListTrashArray<T>::getFreeListHead() const':
FFreeListTrashArray.h:64: error: `m_iFreeListHead' undeclared (first use this function)
FFreeListTrashArray.h: In member function `void FFreeListTrashArray<T>::setFreeListHead(int)':
FFreeListTrashArray.h:68: error: `m_iFreeListHead' undeclared (first use this function)
FFreeListTrashArray.h: In member function `int FFreeListTrashArray<T>::getFreeListCount() const':
FFreeListTrashArray.h:73: error: `m_iFreeListCount' undeclared (first use this function)
FFreeListTrashArray.h: In member function `void FFreeListTrashArray<T>::setFreeListCount(int)':
FFreeListTrashArray.h:77: error: `m_iFreeListCount' undeclared (first use this function)
FFreeListTrashArray.h: In member function `virtual void FFreeListTrashArray<T>::init(int)':
FFreeListTrashArray.h:168: error: `m_iNumSlots' undeclared (first use this function)
FFreeListTrashArray.h:173: error: `m_iLastIndex' undeclared (first use this function)
FFreeListTrashArray.h:174: error: `m_iFreeListHead' undeclared (first use this function)
FFreeListTrashArray.h:175: error: `m_iFreeListCount' undeclared (first use this function)
FFreeListTrashArray.h: In member function `T* FFreeListTrashArray<T>::add()':
FFreeListTrashArray.h:213: error: `m_iLastIndex' undeclared (first use this function)
FFreeListTrashArray.h:213: error: `m_iNumSlots' undeclared (first use this function)
FFreeListTrashArray.h:214: error: `m_iFreeListCount' undeclared (first use this function)
FFreeListTrashArray.h:226: error: `m_iFreeListHead' undeclared (first use this function)
FFreeListTrashArray.h: In member function `virtual T* FFreeListTrashArray<T>::getAt(int)':
FFreeListTrashArray.h:260: error: `m_iLastIndex' undeclared (first use this function)
FFreeListTrashArray.h: In member function `bool FFreeListTrashArray<T>::remove(T*)':
FFreeListTrashArray.h:282: error: `m_iLastIndex' undeclared (first use this function)
FFreeListTrashArray.h: In member function `bool FFreeListTrashArray<T>::removeAt(int)':
FFreeListTrashArray.h:309: error: `m_iLastIndex' undeclared (first use this function)
FFreeListTrashArray.h:317: error: `m_iFreeListHead' undeclared (first use this function)
FFreeListTrashArray.h:319: error: `m_iFreeListCount' undeclared (first use this function)
FFreeListTrashArray.h: In member function `virtual void FFreeListTrashArray<T>::removeAll()':
FFreeListTrashArray.h:343: error: `m_iLastIndex' undeclared (first use this function)
FFreeListTrashArray.h:344: error: `m_iFreeListHead' undeclared (first use this function)
FFreeListTrashArray.h:345: error: `m_iFreeListCount' undeclared (first use this function)
FFreeListTrashArray.h:347: error: `m_iNumSlots' undeclared (first use this function)
FFreeListTrashArray.h: In member function `void FFreeListTrashArray<T>::load(T*)':
FFreeListTrashArray.h:371: error: `m_iLastIndex' undeclared (first use this function)
FFreeListTrashArray.h: In member function `virtual void FFreeListTrashArray<T>::growArray()':
FFreeListTrashArray.h:390: error: `m_iNumSlots' undeclared (first use this function)
FFreeListTrashArray.h: In member function `void FFreeListTrashArray<T>::Write(FDataStreamBase*)':
FFreeListTrashArray.h:465: error: there are no arguments to `getCount' that depend on a template parameter, so a declaration of `getCount' must be available
FFreeListTrashArray.h:465: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
FFreeListTrashArray.h:467: error: there are no arguments to `getIndexAfterLast' that depend on a template parameter, so a declaration of `getIndexAfterLast' must be available
In file included from CvGameCoreDLL.h:172,
                 from CvArea.cpp:3:
FFreeListArray.h: In constructor `FFreeListArray<T>::FFreeListArray()':
FFreeListArray.h:69: error: `m_iFreeListHead' undeclared (first use this function)
FFreeListArray.h:69: error: `FLA_FREE_LIST_INDEX' is not a member of `FFreeList'
FFreeListArray.h:70: error: `m_iFreeListCount' undeclared (first use this function)
FFreeListArray.h:71: error: `m_iLastIndex' undeclared (first use this function)
FFreeListArray.h:72: error: `m_iNumSlots' undeclared (first use this function)
FFreeListArray.h: In member function `virtual void FFreeListArray<T>::init(int)':
FFreeListArray.h:92: error: `m_iFreeListHead' undeclared (first use this function)
FFreeListArray.h:92: error: `FLA_FREE_LIST_INDEX' undeclared (first use this function)
FFreeListArray.h:93: error: `m_iFreeListCount' undeclared (first use this function)
FFreeListArray.h:94: error: `m_iLastIndex' undeclared (first use this function)
FFreeListArray.h:95: error: `m_iNumSlots' undeclared (first use this function)
FFreeListArray.h: In member function `void FFreeListArray<T>::insert(T)':
FFreeListArray.h:131: error: `m_iLastIndex' undeclared (first use this function)
FFreeListArray.h:131: error: `m_iNumSlots' undeclared (first use this function)
FFreeListArray.h:132: error: `m_iFreeListCount' undeclared (first use this function)
FFreeListArray.h:139: error: `m_iFreeListHead' undeclared (first use this function)
Process terminated with status 1 (0 minutes, 26 seconds)
52 errors, 1 warnings
 
It's using the wrong compiler, gcc instead of Visual C++ 2003. It might be possible to change the source to compile with gcc but the linked thread definitely uses VC++ Toolkit 2003, whatever that is.

Did you follow the instructions exactly? Such as downloading it "without compiler". I've not used CodeBlocks so I can't help you but there's probably a setting somewhere to change.

Personally, I acquired Visual Studio 2003 by other means.
 
Back
Top Bottom