Another Compiling Problem. Visual C++ 2010

Bug #885041 reported by Travis on 2011-11-02
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Joris Dauphin

Bug Description

I've got Visual C++ 2010, and all the newest MSVC Libraries and Include files.

I've figured out how to use Bazaar and have downloaded the latest incarnation of the Stratagus Source Code. I also figured out how to use CMAKE to pre-compile the Source into OBJ files. Now, when I loaded the OBJ project up in both VC 2005 and VC 2010, it failed to compile using these files.

I have now decided to go back and copy the most recent source code into the project directory, thereby having the source up-to-date with the most recent version, which for me is the 8011 revision. I am purely trying to just get the code to compile, and the only thing - in both 2005 or 2010 versions of VC++ that is stopping the compiling from completing successfully, is a heap of "lua_objlen" and "LUA_GLOBALSINDEX" in the "ai.cpp" and "script_ai.cpp" files. At the moment there are no other errors besides these, and they are the only errors stopping a successful compile and link-to-exe from happening.

I've checked online to see where these two variables are defined, and they are in the "lua.h" header file that ships with the LUA include folder. I will have another look over my include and lib lookups in VC and also make sure the "lua.h" file has these definitions, even though I am quite certain it does. If so, why is it not picking them up? is it something to do with the Microsoft Compiler? I read somewhere that this mod is going to try and rely less on the new LUA++ libraries/includes...

Joris Dauphin (joris-dauphin) wrote :

The full error message should be more helpful. (compile error: link error ?)
Does CMake report any error ?

To generate vcProj, you should use command line like
 cmake -DCMAKE_INSTALL_PREFIX=/path/to/3rd/ -G "Visual Studio 9 2008" -DENABLE_STATIC=ON

where /path/to/3rd/ have bin/, lib/ include/ of 3rd dependencies.

Travis (dinky-dye-aussie) wrote :

I'll give that a go Joris. I did try another compile last night with the latest trunk version - the errors above were with 7980 version, whereas I have version 8011 as well, so I copied the source files and lib and includes from version 8011 into the 7980 folder, essentially overwriting the older files.

Now the only errors I am getting is to do with the "CPlayer *" and "CPlayer &" declarations, I'll update it with an error readout, Im not on my PC at the moment as I write this. I will try and compile using the command line you specified tho, to see what happens. I just wanna have it compile, then I'll be able to test and report back to you guys.

It's getting closer to compiling successfully and I am very happy most of the problems with it working with Visual C++ are gone. I am trying to learn the C++ language myself, I am a novice, so I am learning Visual Basic to start with (again) and then I will try C++...I wished I'd never gotten rid of my C++ and Game Programming books.

Travis (dinky-dye-aussie) wrote :

Here's the latest Output-Build.txt for my compile attempt using Visual C++ 2010. I did not using CMAKE beforehand either, so this is straight from Visual C++.

Joris Dauphin (joris-dauphin) wrote :

tolua.cpp is no longer directly in src/.
It is an auto-generated file (with tolua++).
Solution (generated from CMake) should regenerate this file. (in project: see stratagus/CMake Rules/tolua.cpp.rule)

To manually regenerate this file:
from stratagus/src/tolua/
-- 8< --
tolua++ -L stratagus.lua -o ../../tolua.cpp stratagus.pkg
-- >8 --

Pali (pali) wrote :

Joris, is generating tolua.cpp file working fine in Visual C++?
Travis, can you try to compile new version 2.2.6 if you see still problems?

Changed in stratagus:
assignee: nobody → Joris Dauphin (joris-dauphin)
Joris Dauphin (joris-dauphin) wrote :

Generation of tolua.cpp works fine in visual (at least in VS 2008)

Travis (dinky-dye-aussie) wrote :

So Joris, Pali. Do I need to make it with CMAKE first? Let me know. I tried out 2.2.6 the other night. Using the default skirmish map I had a game and it ran for about 20 minutes, then kicked me out, I'll have to do a debug run to see what occured - at least the AI hasn't fully upgraded when I am just starting with the new version.

Also what's with all the new inf files for the audio?! they were never in there with the older version...The extraction process is much more complcated now, but that's ok I guess.

There's still lots of testing I'll get to doing when I have time, but the newest version does feel alot more stable. I have yet to play the campaigns too, but I want to do that.

Pali (pali) wrote :

Yes, you need to use CMake for generate files for Visual C++.
Extraction process now extract & convert XMI MIDI files (for background music) if there is no CDDA sound tracks on original CD.

Changed in stratagus:
status: New → Fix Released
Changed in stratagus:
milestone: none → 2.2.7
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers