Building the SDK in Visual Studio 2008?

Glak

Chieftain
Joined
May 6, 2009
Messages
35
Hi. I recently got BtS and want to start modding. I am using the SDK code that came with BtS. I already have Visual C++ Express Edition set up on my computer. When I attempt to build the SDK I get a single error in the boost python library. I've read some threads here but they all mention the 2003 toolkit with code::blocks. I used it long ago but I'd rather not reinstall for fear of disrupting my 2008 installation. There is only one error so I'm wondering if someone with more knowledge could help me fix it:

c:\program files\sid meier's civilization 4\cvgamecoredll\boost-1.32.0\include\boost\python\data_members.hpp(278) : error C2665: 'boost::python::detail::make_getter' : none of the 3 overloads could convert all the argument types

The code is:

Code:
#  if !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) && !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
template <class D>
inline object make_getter(D const& d)
{
    detail::not_specified policy;
    return detail::make_getter(d, policy, is_member_pointer<D>(), 0L);
}
#  endif

I tried adding "const" in front of the declaration of policy to match up with the call to detail::make_getter but I get the same error. If I comment out the code entirely (just to see what happens) I get the same error in the make_setter function. If I comment that out I get the expected error from a civ file about not being able to find the function. I googled around for a bit but it looks like the boost python project is dead or dying.

Thanks
 
Welcome to the forums, Glak! I had the same problem, so I'll redirect you here. It has an excellent tutorial. I tend to use VS2008 for editing the files, then Codeblocks for compilation.
 
I use VS2005 Express Edition because that's the first one that I got working. I have it use a makefile to compile using VC++ Tookit 2003, and you should be able to do the same in VS2008.

This post in this thread has the latest makefile (BTS 3.17) that you'll need. The thread itself should have instructions that will get you going. It sounds like you are already familiar with VS, so hopefully this won't be too hard.

I had to download the platform SDK, but it may be included in the full version of VS2008. There were a couple other libraries that you'll need which should be in the instructions.

I ended up getting Refar's PDF instructions to work for me.
 
I've been tinkering with the DLL using Visual C++ 2008 Express, and everything worked fine until I tried adding a new file. Do I need to edit Refar's makefile very time I add a new file? Should I just use Codeblocks after all?
 
Yes, you need to add the file to the makefile, and it's kind of a PITA. Best way is to pick a file like CvGame and search for all places it is found. Make the same changes for your file.

Doesn' Code::Blocks use the same makefile?
 
Right after posting, I went ahead and added entries for the new files I'd added, and everything went fine. It's really not that big a deal, since it's something you only need to do once. Do you know whether the order of the files in the various entries matters? The existing listings are in alphabetical order.

If compiling with Codeblocks really does use the makefile, I really don't understand why you'd want to use that instead of Visual Studio.
 
IIRC, order shouldn't matter--definitely not between two files that don't depend on each other.

The PITA part is that you need to make the changes for each build target even though both targets contain the same sets of files.
 
Top Bottom