Scons can't find 'boost/shared_ptr.h'

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
smokedart
Krill Swarm
Posts: 10
Joined: Sun Sep 28, 2008 6:33 am

Scons can't find 'boost/shared_ptr.h'

#1 Post by smokedart »

Hey all,

I've been reading through the forums and played a bit of the game over the last few days - I really like it so far and I'd like to help out a bit. I've never used scons before though and I'm having some trouble getting it to compile.

I have the freeorion sdk in c:\freeorion_sdk and I updated the freeorion source within that directory from SVN.

Here is the error I get:

Code: Select all

C:\freeorion_sdk\FreeOrion\GG>scons configure
scons: Reading SConscript files ...
Checking for pkg-config... no
Configuring for WIN32 system...
Checking for C++ header file boost/shared_ptr.hpp... no
Boost configuration... (cached) no
Here is my path:

Code: Select all

C:\freeorion_sdk\FreeOrion\GG>path
PATH=C:\Python25\;C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\Program Files\OpenSSH\bin;
C:\Program Files\Subversion\bin;
C:\Program Files\TortoiseSVN\bin;
C:\Program Files\QuickTime\QTSystem\;C:\Python25\Scripts\;
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include;
C:\Program Files\SSH Communications Security\SSH Secure Shell;
C:\Program Files\Nmap;
C:\freeorion_sdk\Boost\include\boost-1_35\boost;
C:\freeorion_sdk\Boost\include\boost-1_35;
And here is the config.log from that directory:

Code: Select all

file C:\freeorion_sdk\FreeOrion\GG\SConstruct,line 266:
	Configure(confdir = .sconf_temp)
scons: Configure: Checking for pkg-config... 
pkg-config --atleast-pkgconfig-version 0.15.0
'pkg-config' is not recognized as an internal or external command,
operable program or batch file.
scons: Configure: no

scons: Configure: Checking for C++ header file boost/shared_ptr.hpp... 
.sconf_temp\conftest_1.cpp <-
  |
  |#include "boost/shared_ptr.hpp"
  |
  |
cl /nologo /TP /c .sconf_temp\conftest_1.cpp /Fo.sconf_temp\conftest_1.obj
conftest_1.cpp
.sconf_temp\conftest_1.cpp(2) : fatal error C1083: Cannot open include file: 'boost/shared_ptr.hpp': No such file or directory
scons: Configure: no

scons: Configure: Boost configuration... 
scons: Configure: (cached) no
Anyone have any ideas?

Thanks,
Gregg

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Scons can't find 'boost/shared_ptr.h'

#2 Post by Geoff the Medio »

It's been a while, but I vaguely recall there being problems with SCons and the version of Boost that FreeOrion and GG are using.

You might have better luck trying the MSVC project files for FreeOrion, which don't build GG as a separate library. I believe they've been reported to work with the express edition of MSVC 2008.

smokedart
Krill Swarm
Posts: 10
Joined: Sun Sep 28, 2008 6:33 am

Re: Scons can't find 'boost/shared_ptr.h'

#3 Post by smokedart »

Thanks for the reply, I've noticed that requests for help get answered quickly on this forum which speaks very well to the quality of the community.

Unfortunately, I already tried MSVC Express 2008 and it wouldn't compile. So I tried 2005. That failed too. And so I thought, heck with the MS stuff, I'll go with the scons build tool. But now I'm at triple fail.

I'm thinking maybe it's a path setting since all three have failed. I got one of the pieces to compile under 2005. I think it was freeorionca. But that failed at the linking stage. At this point I wish there were a feature in the include setttings that was simply, if all else fails, search C:\*.* for anything even resembling the %$^#&%ing file you want. :)

I have all the files it complains about not finding, and I keep adding all the paths to them each time it complains, but now I have all the paths added and it still seems to have issues. I guess I can try under Ubuntu 8.04 and see if i can get it compiling there.

For anyone out there that has it compiling using MSVC 2005 or 2008 or scons, wouild you mind posting your path and includes list?

Cheers,
Gregg

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Scons can't find 'boost/shared_ptr.h'

#4 Post by Geoff the Medio »

Compiling with MSVC 2008 or 2005 should work (almost) without modifying anything if you've downloaded the Windows FreeOrion SDK and then updated from SVN. Did you move the various directories within the SDK directory around to different relative pathes?

stride
Space Floater
Posts: 31
Joined: Sun Sep 28, 2008 3:05 pm
Location: Horten, Norway

Re: Scons can't find 'boost/shared_ptr.h'

#5 Post by stride »

Got it working with MS Visual C++ 2005 Express SP1 without any scons compile after some trial and error.

Started by creating D:\FreeOrion to hold all stuff. Yeah, C: is always nearly full.

Unzipped the SDK so it ended up in D:\FreeOrion\FreeOrion_SDK. Deleted old FreeOrion source still in the SDK's path, but left the dll's in there.

Pulled out the SVN source into D:\FreeOrion\freeorion, with the intention of keeping that path nice, clean and manageable with my SVN client.

It just didn't feel right adding various include and lib paths in MS VC's global compiler and linker options, so I added paths for both the SDK's include and lib locations to all 3 project nodes instead. Did the same thing with the Boost includes and libs somewhere inside the SDK.

Downloaded and installed Windows Server 2003 Platform SDK, then added include and lib paths on each project node.

Python25, same procedure...

Linker kept complaining about some dependancy for process.cpp, which is solved by adding user32.lib from the Platform SDK to Project property, Linker, Input, Additional dependencies.

It now compiles and links ok.


A lot of hazzle but at least I got a nice walkthrough of the different dependencies. SDK is stripped down to... SDK'ish things, which is good.

I tried adding the location of the dll's into the system path, but that did not work well. Ended up with copying them into the SVN path instead. Argh... clutter... not so good.

Oh well :)

M.
Last edited by stride on Thu Oct 02, 2008 2:01 pm, edited 1 time in total.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Scons can't find 'boost/shared_ptr.h'

#6 Post by Geoff the Medio »

Thanks for posting what you needed to do to get it working. I'm surprised it took that much, as the include and linker paths were intended to be relative for most dependencies (eg. excluding Python) though I haven't actually tried with the 2005 Express Edition myself...

stride
Space Floater
Posts: 31
Joined: Sun Sep 28, 2008 3:05 pm
Location: Horten, Norway

Re: Scons can't find 'boost/shared_ptr.h'

#7 Post by stride »

Geoff the Medio wrote:Thanks for posting what you needed to do to get it working. I'm surprised it took that much, as the include and linker paths were intended to be relative for most dependencies (eg. excluding Python) though I haven't actually tried with the 2005 Express Edition myself...
Compiler and linker paths are probably (almost) correct as stated earlier. I'm a bit of a control-freak and after a couple of failures I decided to put the SVN source elsewhere and pull in the dependencies one by one instead :)

You know, it might be an idea to strip down the SDK as much as possible, and also adding various Linux includes, libs and shared objects. This would simplify compile and install, plus a few bugs might be avoided by using "official" versions of libraries. I figure version-controlling it would keep it nice and consistent.



I found a solution for still keeping the DLL's inside the SDK btw, excellent. Now I'm happy :)
Microsoft has offered a solution to all these problems. Each application can now store it own path the registry under the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

The use the application path, set a key for your application, using ONE.EXE from the example above:

HKEY_LOCAL_MACHINE\...\CurrentVersion\App Paths\ONE.exe

Set the (Default) value to the full path of your executable, for example:

C:\Program Files\ONE\ONE.exe

Add a sub-key named Path, set it's value to the full path of the DLL, for example:

C:\Program Files\Common

With an App Path registry entry, the system will load DLLs in the following order.

1. The directories listed in the App Path registry key
2. The directory where the executable module for the current process is located.
3. The current directory.
4. The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
5. The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
6. The directories listed in the PATH environment variable.

Run REGEDIT to see examples of other applications, and how they setup their App Path keys.

smokedart
Krill Swarm
Posts: 10
Joined: Sun Sep 28, 2008 6:33 am

Re: Scons can't find 'boost/shared_ptr.h'

#8 Post by smokedart »

Ok, so it seems I'm a moran. :) But thanks to everyone who replied and offered suggestions.

My friend, peruvianllama, is the one that found FO and suggested to me that we get involved since we liked a similar game, Space Empires, but found there were a number of small issues that detracted from the game play for us, and 'Wouldn't it be great if we could go in and fix that ourselves?'. That trigged our interest in FO. I happened to be the first to try compiling it though.

He tried installing last night and after about 5 mins (I think that included download time) told me it was compiling. Without errors. So I uninstallked VC2005, reinstalled 2008, and it started compiling no problem. Sigh.

We did encounter a few problems before it compiled and linked completely though, and we'll document those and the way to fix them, and provide updates for the wiki/SDK.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Scons can't find 'boost/shared_ptr.h'

#9 Post by Geoff the Medio »

stride wrote:
Geoff the Medio wrote:You know, it might be an idea to strip down the SDK as much as possible, and also adding various Linux includes, libs and shared objects. This would simplify compile and install, plus a few bugs might be avoided by using "official" versions of libraries. I figure version-controlling it would keep it nice and consistent.
The SDK is intentionally Windows only. I'm not a linux person, but my understanding is that there is too much variation between different linux distros for a single SDK to be feasible.

User avatar
OndrejR
Space Dragon
Posts: 339
Joined: Thu Oct 02, 2008 11:00 pm
Location: Slovakia

Re: Scons can't find 'boost/shared_ptr.h'

#10 Post by OndrejR »

Geoff the Medio wrote:The SDK is intentionally Windows only. I'm not a linux person, but my understanding is that there is too much variation between different linux distros for a single SDK to be feasible.
In linux(and also in Windows) there is perfect free multiplatform SDK - Eclipse. I wrote howto. It is on wiki linux compile howto.
Last edited by OndrejR on Tue Aug 11, 2009 4:24 pm, edited 1 time in total.

Peter
Space Krill
Posts: 6
Joined: Thu Jun 04, 2009 11:32 pm
Location: Berlin, Germany

Re: Scons can't find 'boost/shared_ptr.h'

#11 Post by Peter »

I got the same error (missing shared_ptr.h) and was finally able to solve that by simply using the Visual Studio Command Line in Start->Programms->Microsoft Visual Studio 2008->Visual Studio Tools rather than the default cmd.exe (I'm not perfectly sure whether this is the correct translation for the English version, but I think you are able to find it though ;)).
Object extends Chuck Norris

gthx
Krill Swarm
Posts: 14
Joined: Mon Aug 10, 2009 10:06 am
Location: Finland

Re: Scons can't find 'boost/shared_ptr.h'

#12 Post by gthx »

Peter wrote:.. Visual Studio Command Line .. rather than the default cmd.exe ..
Good one Peter. I don't know why I always forget this one.

P.S. This should be added to README.txt

Post Reply