# 2 questions...

## Recommended Posts

1) Is it possible to get boost to work with Vs2008 or do I have top wait for an update for boost? I'm getting a bit fed up with having to use 2005 express to compile anything that uses one of the boost libarys because boost throws errors under vs 2008... 2) I still havn't found a good way to run my game loop. Most of the time function only have ~15ms accuracy and the high resolution one isn't supported by all systems. As a result my update loop that I want to run 50 times a second often only runs like 45 times even when cpu useage is at 5% :( All the examples ive found around seem to use functions that are part of a libary (eg SDL) and I don't really want to use a large libary just for a timer...

##### Share on other sites
You should be able to compile the latest source trunk with VC2008.
If you have downloaded the stable boost release (as I did) you can update it manually by using this patch

I ended up adding the patch by poking around in the source (its not that many entries) and it worked like a charm

##### Share on other sites
boost works just fine for me in VS 2008 Pro, the only *small* issue I have is the boost::bind library will output an error message to the debugger saying that the compiler is unsupported.

As for your timing issues...why not take a look at the SDL source and see how they handle timers for each of the platforms they support? Or are you just worried about QueryPerformanceCounter not working on multi-CPU systems?

##### Share on other sites
I just get this and it doesn't compile under VS2008 Pro
"Unknown compiler version - please run the configure tests and report the results"
I looked around on the boost site but couldn't find any instructions on what I am meant to do...Only how to change stuff not add a new compiler/compiler version :(

##### Share on other sites
Quote:
 Original post by Sync ViewsI just get this and it doesn't compile under VS2008 Pro"Unknown compiler version - please run the configure tests and report the results"I looked around on the boost site but couldn't find any instructions on what I am meant to do...Only how to change stuff not add a new compiler/compiler version :(

I get that but it compiles fine, it's just a debug message spit out by the boost heades. What's the actual compilation error that you get?

##### Share on other sites
in the link stage I then get:
"LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc80-mt-gd-1_34_1.lib'"

That file seems to not even exist anywhere so I'm not sure what to do about it... I'm asuming it's linked to the warning/message I get before.

##### Share on other sites
Quote:
 Original post by Sync Viewsin the link stage I then get:"LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc80-mt-gd-1_34_1.lib'"That file seems to not even exist anywhere so I'm not sure what to do about it... I'm asuming it's linked to the warning/message I get before.

Kinda. Did you build the libraries with bjam? It ends up building with a slightly different tag (e.g. "vs"? instead of "vc80") for the old versions. This can be fixed by properly renaming the libraries in question, although you'll still get those warnings about unsupported compiler. Alternatively you could poke around in the config headers to find where it selects the identifier to use, and tweak it to use vc80 there.

I did the former (renamed the files via Ruby script) until I decided I wanted the svn trunk version for it's other as of yet unreleased updates, and it worked fine other than the "Unknown compiler version" message. (As already mentioned, svn trunk has been updated to do the right thing itselfTM, which means 1.35.0 -- whenever it's released -- shouldn't have this issue, if you're the patient type who'd rather just wait out for the next release).

##### Share on other sites
Can I have some step by step instructions cause like I said I don't have any libarys even remotly like the one it says it can't find...

I'm guesing I need to build something but there is 0 documentation on exacctly which downloads and what settings vs2008 needs....I'm guessing I need to use this bjam thing but there doesn't seem to be a windows binary and I don't understand how to make one....

for the timer game loop I just want a good way to do this that ensures the update function is called 50 times a second...Everywhere says that "QueryPerformanceCounter" is hardware dependent and things like GetTickCount seem to only be accurate to just over 15ms...
	while(GameRun)	{				while(PeekMessage(&Msg, NULL, NULL, NULL, PM_REMOVE))		{			if(Msg.message == WM_QUIT) GameRun = false;			TranslateMessage (&Msg);			DispatchMessage  (&Msg);		}				Update();//50 times a second		Render();//as fast as possible while keeping the update at 50 times a second	}

[Edited by - Sync Views on March 21, 2008 6:19:23 PM]

##### Share on other sites
I compiled from boost trunk using vs2008. use tortise svn as windows client to download. the trunk has the fix for vs2008 version and (at least) two other small source patches.

to create the libs i had to run bjam a couple of times - one for static and one for dll libs. for static lib's i had to add the following to fix a naming issue that would prevent linking in vs2008.

also add the 'stage' modifier as an argument to the bjam command which will move the compiled libs up to a top level directory boost. sorry if this is a bit unclear - as this is from memory since i dont have my notes with me as to precisely what i did. It took me a little bit of fiddling and googling but this was quicker than using the boost getting started documentation which is a bit to verbose and doesnt really contain the needed info for vs2008 since its not officially supported.

##### Share on other sites

Will that actauly work because right now I havn't even got bjam as I couldn't find a windows binary and the build.bat thing gives errors about the include path not being set :(

##### Share on other sites
Quote:
 Original post by Sync ViewsCan I have some step by step instructions cause like I said I don't have any libarys even remotly like the one it says it can't find...

See Getting Started.

Quote:
 Original post by Sync ViewsWill that actauly work because right now I havn't even got bjam as I couldn't find a windows binary and the build.bat thing gives errors about the include path not being set :(

You still need to use bjam. The download is here. It is the "ntx86" version.

##### Share on other sites
That doesn't help when all the links are for 2003/2005 and it doesn't even say how to get bjam for windows with vs2008 (none of these look like windows binaries to me... )because the build.bat in non-working (something about include path not set as I said before) and the build instructions don't have vc9 and vc8 gives me these errors...

###### Using 'vc8' toolset.###H:\boost\tools\jam\src>rd /S /Q bootstrapH:\boost\tools\jam\src>md bootstrapH:\boost\tools\jam\src>cl /nologo /RTC1 /Zi /MTd -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib /Febootstrap\jam0  command.c compile.c debug.c execnt.c expand.c filent.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c newstr.c option.c parse.c pathunix.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c w32_getreg.c native.c modules/set.c modules/path.c modules/regex.c  modules/property-set.c modules/sequence.c modules/order.ccommand.ch:\boost\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h: no include path setcompile.ch:\boost\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h: no include path setdebug.ch:\boost\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h: no include path setexecnt.ch:\boost\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h: no include path setexpand.ch:\boost\tools\jam\src\jam.h(88) : fatal error C1034: fcntl.h: no include path setfilent.c...

##### Share on other sites
To install boost_1_34_1 for VC2008:

3. Locate patch.exe and copy it to WINDOWS/System32
4. Save this file under 'boost_1_34_1' as MyPatch.txt (In the folder containing another boost_1_34_1 folder):

=== modified file 'boost_1_34_1/boost/config/auto_link.hpp'--- boost_1_34_1/boost/config/auto_link.hpp	2008-02-21 22:18:03 +0000+++ boost_1_34_1/boost/config/auto_link.hpp	2008-02-21 22:23:57 +0000@@ -130,11 +130,16 @@    // vc71: #  define BOOST_LIB_TOOLSET "vc71" -#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1400)+#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1400)     // vc80: #  define BOOST_LIB_TOOLSET "vc80" +#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1500)++   // vc90:+#  define BOOST_LIB_TOOLSET "vc90"+ #elif defined(__BORLANDC__)     // CBuilder 6:=== modified file 'boost_1_34_1/boost/config/compiler/visualc.hpp'--- boost_1_34_1/boost/config/compiler/visualc.hpp	2008-02-21 22:18:03 +0000+++ boost_1_34_1/boost/config/compiler/visualc.hpp	2008-02-21 22:23:57 +0000@@ -168,8 +168,8 @@ #error "Compiler not supported or configured - please reconfigure" #endif //-// last known and checked version is 1400 (VC8):-#if (_MSC_VER > 1400)+// last known and checked version is 1500 (VC9):+#if (_MSC_VER > 1500) #  if defined(BOOST_ASSERT_CONFIG) #     error "Unknown compiler version - please run the configure tests and report the results" #  else=== modified file 'boost_1_34_1/boost/signals/detail/named_slot_map.hpp'--- boost_1_34_1/boost/signals/detail/named_slot_map.hpp	2008-02-21 22:18:03 +0000+++ boost_1_34_1/boost/signals/detail/named_slot_map.hpp	2008-02-21 22:26:06 +0000@@ -127,7 +127,7 @@         || slot_ == other.slot_));   } -#if BOOST_WORKAROUND(_MSC_VER, <= 1400)+#if BOOST_WORKAROUND(_MSC_VER, <= 1500)   void decrement();   void advance(difference_type); #endif=== modified file 'boost_1_34_1/libs/signals/src/named_slot_map.cpp'--- boost_1_34_1/libs/signals/src/named_slot_map.cpp	2008-02-21 22:18:03 +0000+++ boost_1_34_1/libs/signals/src/named_slot_map.cpp	2008-02-21 22:26:09 +0000@@ -24,7 +24,7 @@ typedef slot_container_type::const_iterator const_group_iterator;  -#if BOOST_WORKAROUND(_MSC_VER, <= 1400)+#if BOOST_WORKAROUND(_MSC_VER, <= 1500) void named_slot_map_iterator::decrement() { assert(false); } void named_slot_map_iterator::advance(difference_type) { assert(false); } #endif=== modified file 'boost_1_34_1/tools/build/v2/tools/msvc.jam'--- boost_1_34_1/tools/build/v2/tools/msvc.jam	2008-02-21 22:18:03 +0000+++ boost_1_34_1/tools/build/v2/tools/msvc.jam	2008-02-21 22:23:57 +0000@@ -231,7 +231,11 @@         {             # Even if version is not explicitly specified, try to detect the version             # from the path.-            if [ MATCH "(Microsoft Visual Studio 8)" : $(command) ]+ if [ MATCH "(Microsoft Visual Studio 9.0)" :$(command) ]+            {+                version = 9.0 ;+            }                 +            else if [ MATCH "(Microsoft Visual Studio 8)" : \$(command) ]             {                 version = 8.0 ;             }                 @@ -913,13 +917,14 @@  .ProgramFiles = [ path.make [ common.get-program-files-dir ] ] ; -.known-versions = 8.0 8.0express 7.1 7.1toolkit 7.0 6.0 ;+.known-versions = 9.0 9.0express 8.0 8.0express 7.1 7.1toolkit 7.0 6.0 ;  # Version aliases .version-alias-6 = 6.0 ; .version-alias-6.5 = 6.0 ; .version-alias-7 = 7.0 ; .version-alias-8 = 8.0 ;+.version-alias-9 = 9.0 ;   # Name of the registry key that contains Visual C++ installation path #   (relative to "HKEY_LOCAL_MACHINE\SOFTWARE\\Microsoft"@@ -928,6 +933,8 @@ .version-7.1-reg = "VisualStudio\\7.1\\Setup\\VC" ; .version-8.0-reg = "VisualStudio\\8.0\\Setup\\VC" ; .version-8.0express-reg = "VCExpress\\8.0\\Setup\\VC" ;+.version-9.0-reg = "VisualStudio\\9.0\\Setup\\VC" ;+.version-9.0express-reg = "VCExpress\\9.0\\Setup\\VC" ;  # Visual C++ Toolkit 2003 do not store its installation path in the registry. # The environment variable 'VCToolkitInstallDir' and the default installation

5. Open a console and navigate to the boost_1_34_1 folder where the patch file is.
6. Run patch.exe using MyPatch.txt as inputfile
7. Download bjam.exe (The one that ends with ntx86.zip) and place it under the boost_1_34_1/boost_1_34_1 folder.
8. Execute the vcvarsall.bat from within the console to set up the compilers environment (Location: H:\Program files\Microsoft Visual Studio 9.0\VC).
9. Navigate to the boost_1_34_1/boost_1_34_1 folder and run bjam.exe from there using 'vc90' as the toolset

[Edited by - pulpfist on March 22, 2008 10:16:19 AM]

##### Share on other sites
How long is the "patch patch.txt" meant to take? It's just sat there doing nothing for the past half hour without even provideing any console output to say what it's doing...

##### Share on other sites
You need to use the -i switch.

patch.exe -i MyPatch.txt

I also added another step to my last post. Step 8, which is important

##### Share on other sites
This shouldn't be so complicated. You get yourself boost from trunk. You have to since the stable version in sourceforge is 1.34, and it is not updated for VC 2008. Get the trunk version. You have to do nothing special after downloading trunk vs. downloading stable.

Then get bjam. You want the ntx86 version. Now follow the Boost Getting Started page. This is effectively what you do (summarized from that page). You need to run the appropriate command from the command prompt. But in doing so, you need ot make sure the compiler is in the environment path variable. With Visual Studio 2008, the easiest way is to go to the start menu entry and find something that says VS 2008 Command Prompt or something like that. Run it, use the command prompt to navigate to boost directory. Then type in the appropriate 'bjam blah blah blah' commands as shown on the Getting Started page.

Take a note that most of boost is header only. The only parts of boost that compile are portions like program_options, regex, filesystem, and what not. So you don't even have to compile anything to use a large portion of boost.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627694
• Total Posts
2978673

• 19
• 14
• 12
• 10
• 12