Compiling with VS 2008

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Compiling with VS 2008

      I was a big fan of the second edition and just received my copy of the 3rd edition from amazon. Needless to say, I was excited to dive in -- used svn to check out the code, extracted the 3rd party libraries to the source directory, etc. etc. hit 'Build Solution' and... 717 errors??

      All of the errors seem to be center around Lua-related objects.

      I just upgraded to Visual Studio 2008 standard. Clearly I'm doing something wrong, but I followed all the directions from the devsetup file. I was wondering if anyone else is having this problem, if maybe there are some extra settings in VS 2008?

      Am I missing a step somewhere? Are the Lua headers supposed to be somewhere besides GameCode3\Source\3rdParty?
    • Hi,

      I'm currently still installing VS05 to help there. But as soon as that installation is complete I'll install VS08 and try to compile GCC3 in it.
      But I'm pretty sure that if the setup is correct there won't be any problems, migrating from VS05 to VS08 should be painless (contrary to 03.NET to 05 upgrade).
    • Hi!

      I managed to setup the environment in Windows Vista-Vs2008 Express, briefly i did in this order:

      1) Using Directx SDK (DXSDK_Mar09)
      2) boost_1_38_0, i downloaded the sources and rebuilded using bjam for the rquired libs that were in the 3rd party libs (building the libraries took me 4 hours and 8Gb in my HDD!)
      3) Downloaded LuaPlus from SVN (mine was 30/04/09 - 12:40 431) build and point libs, copy dll, etc...

      Also, you will get errors with the atltypes.h include. YOU WONT FIND the atl in your vs2008 express/platform SDK installation, search for a post in the forums regarding this problem

      I dont recall if it was on debug/release in which the lang project was not included as a dependency of the project, check for yourself

      Good luck!

      @B^)>
    • Forgot to mention I am running WinXp, and I do have the full version of VS 2008 (not express).

      As I understand it I shouldn't have to compile/install the full versions of boost/LuaPlus/etc. as he includes the headers/libraries that are needed to compile this project.
    • Originally posted by gsboys
      Forgot to mention I am running WinXp, and I do have the full version of VS 2008 (not express).

      As I understand it I shouldn't have to compile/install the full versions of boost/LuaPlus/etc. as he includes the headers/libraries that are needed to compile this project.

      That is true, but compiled (static) libraries are not necessarily compatible between different compilers (but it surprises me if VS08 can't use the ones from VS05). And if I understand kidchaos correctly that was the problem he encountered.
    • Ah I see -- and I suppose that may be a problem, but it seems to me that the various files in the GameCode3 project can't find the headers. I went in to "Properties->C/C++" and checked the additional include directories but they are all pointing to the right place:

      i.e. $(SolutionDir)3rdParty\LuaPlus\Src

      I'm getting errors like: "syntax identifier 'LuaObject' and related messages in a bunch of the game code headers/scripting related files.
    • Bleh - sorry there's so much trouble with VC2008. Thanks again Microsoft!

      I don't actually have a copy of VC2008 - can anyone else out there lend a hand? I'll send you a free copy of the book if you figure it out.
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • Btw there's a post in another thread that suggests you recompile the libraries if you are using VC2008. Have you tried that???
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • What is the best way to go about re-building these libraries? I am somewhat new to Windows programming, and as a Mac user I'm used to doing this stuff through Terminal but I have a feeling that I can be using VC 2008 for some if not all of this. Should I be using bjam through command prompt for the boost libraries? LuaPlus documentation is non-existant so I'm not even sure where to start on that one, and it seems that is the one that is giving me the trouble...

      Thanks to everyone for your responses.
    • I can install VS08 and rebuild the libraries if no one else can or wants to ;)

      The libraries as in the 3rdParty.zip are not suited for recompilation, because Mike stripped them heavily. But I still have the unstripped ones on my disk, so recompiling with VS08 is not that much trouble for me (if it's indeed needed).

      But I also don't want to ruin somebodys chance to grab a free book :)
    • I tried recompiling it in vs2008, but got errors.

      Source Code

      1. Error 1 error C3861: 'LuaState_UserStateOpen_Internal': identifier not found d:\projects\private\gamecode3\3rdparty\luaplus\src\luaplus\luaplus.cpp 137 LuaPlusLib
      2. Error 2 error C3861: 'LuaState_UserStateThread_Internal': identifier not found d:\projects\private\gamecode3\3rdparty\luaplus\src\luaplus\luaplus.cpp 143 LuaPlusLib
      3. Error 3 error C3861: 'LuaState_UserStateFree_Internal': identifier not found d:\projects\private\gamecode3\3rdparty\luaplus\src\luaplus\luaplus.cpp 149 LuaPlusLib


      Haven't tried changing stuff yet, will give it a try tonight or so. Seems like it just lacks some predefinitions.
    • Hm and those are different than the errors that I was getting. I noticed in my attempts to rebuild the LuaPlus libraries that their was a LuaPlusLib project that Mike didn't include in the 3rdParty zip. But I know nothing about Lua, let alone LuaPlus (haven't gotten to that chapter as I wanted to be able to compile and run before I dived in) and since the documentation for LuaPlus doesn't say much about building/installing I am pretty lost.

      Regardless, I still have a hunch that my errors are more basic and it has something to do with the way the project is set up, but this is the first time I've touched VS since .NET 2003 and I didn't really have a firm grasp on it back then.

      As a side note I successfully compiled the version 2 source code on VS2008 express last year (following the instructions on the thread about atl) and it compiled and ran fine except for the lack of physics.

      The funny thing is I've been reading this book for years now and I have yet to actually play the game...at any rate, I'll keep my eyes on this thread. Thanks again to everyone for their help.
    • Ok, I installed VS08 and found the problem: LuaPlus has a namespace called LuaPlus but inside GCC3 sourcecode you never prepend all the LuaPlus classes with LuaPlus:: (and inserting it in front of the LuaPlus objects on the errors fixes it). I got ~3300 errors, I suppose that there're not as many instances where you have to put the namespace, but it looks still like a bit of boring work.

      I don't know why it is working in VS05, because actors.h has clearly no using namespace or anything else that makes the content of LuaPlus globally available. And I didn't find anything inside GameCode3 project's settings in VS05 that would explain this. I also checked the LuaObject.h file and there's also nothing that would explain this.
      Maybe it's a compiler bug in VC8?
    • I had the same issues as OP with using VS2008. Much cursing about MrMike's use of VS2005 ensued.
      I did get it to work in the end but it took 2 weeks of spare time tinkering so I can't remember off hand all
      the steps I took.
      Main issue is the Libs compiled in VS2005 not wanting to play ball with VS2008. But there were a couple other things that needed changing to do with LuaPlus not wanting to stick around without invitation.

      So yes, this post is about as much use as a chocolate teapot. sorry.
    • Originally posted by gsboys
      So close.......

      Extra boost libs aren't extracting from the zip due to an "unknown compression method". Is this just me or is the file actually corrupt?

      Thanks again!

      The compression method is bzip2, so you need an archive manager that can handle this compression type. As Odesune pointed out 7-Zip can do that and is for free (actually I used 7-Zip to create it in the first place).
    • Originally posted by gsboys
      Success! Thanks a lot -- feels good to finally see it in action, even if I end up spinning hopelessly off the grid 99% of the time...

      Thanks again

      Me too and somebody should add some geometry around the ground plane that pushes you back from the borders :)