Trouble compiling and running code

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

    • Trouble compiling and running code

      Hello,
      I recently purchased the 3rd edition of this book and wanted to see the code for some of the projects that are made with it.

      I followed advice on the forums and downloaded the latest copy from the test folder using the svn command. I downloaded the 3rd party libraries and headers, and finally followed the readme instructions.

      I am running into a variety of errors.

      The first is that (Keep in mind i am using visual studio 2010 standard, not express) is that i am getting errors in the string.cpp file. std:: is underlined with red for some reason and it says

      error C2275: 'std::string' : illegal use of this type as an expression

      This occurs 6 more times in two different files

      there were many shared_ptr ambiguous errors saying that it could come from boost or another std source. I fixed these problems but i assume there was a better work around. Especially because this work around does not work 100 percent of the time.

      The last group of errors come from editor global functions with std::string

      So far these 3 groups of errors(roughly 40 according to visual studio 2010) have me stumped. Any advice or help you can give? Am i being too vague?

      I heard this book was one of the best and i wanted to look at the code before I entered. I also understand that probably not everything is posted in the book, so getting the code working would be great.

      thanks
      Anthony

      Edit: If my grammar or question seems off please tell me. After all I proof read it , but I was never a good English student

      The post was edited 1 time, last by ajp29 ().

    • I ran into these issues too, although I'm building from the trunk folder instead of test, there might be slight differences.

      To solve the std::string error, do a global replace of "std::string.npos" with "std::string::npos"

      Also, to solve the shared_ptr ambiguity error, I did a global replace of "shared_ptr" with "boost::shared_ptr" and then another replace of "boost::boost::" with "boost::" and "boost\boost::" with "boost\" to fix all the ones I broke with the first global replace.

      After doing all that, all I have left are two unresolved external symbols in "libboost_thread-vc90-" which I suspect is because I'm possibly using the wrong 3rd party zip, or because I manually added the library paths wrong (I'm new at this too).
    • Hi all, I'm trying to build the code following the instructions, but VS gives me this:

      "Error 3 error C1083: Cannot open include file: 'dxerr9.h': No such file or directory c:\gamecode3\gamecode3\source\dx10\dxstdafx.h 72 1 GameCode3"

      I tried to change "dxerr9.h" with "dxerr.h", as Mr Mike said, but it gives me a lot more errors.
      I correctly imported DirectX SDK and the other libraries, i think i'm missing something... please help me! :)
      www.infinitedev.it
    • Ok... well Mr. Mike is fixing the code so you'll have to just wait.
      Also, under the 'Linker' option for the project, under the 'Input' tab, you may have to change dxerr9.h to dxerr.h. I doubt that'll fix everything, and it may already be fixed. But feel free to do that if it makes you feel better :D
    • Depending on what versions of everything you are using your solutions may be different.

      I even think I wrote something about that in the book somewhere - now if I could only remember it! LOL.

      Things you should post back with:
      - Which branch of GameCode 3 are you using (main or test?)
      - Which version of Visual Studio are you using?
      - Which version of DirectX are you using?
      - Which verion of the 3rdParty.zip are you using?

      We should be able to get you sorted out.
      Mr.Mike
      Author, Programmer, Brewer, Patriot