The Help Thread

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

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

Re: The Help Thread

#271 Post by Geoff the Medio »

next_ghost wrote:

Code: Select all

if( baseclass_pointer->is_design_type( enum_type ) ) {
    m_buildable_items->Insert( baseclass_pointer->premade_row() );
}
You probably don't want to have the buildable items list ListBox::Row as a member variable or function return type in the base class for buildable items. It's unnecessary coupling and dependence of a universe / gamestate class on a UI class. Depending on details of implementation, that might make much of the server depend on UI classes, for example.

Better would be for the buildable items list class to contain a map of buildable items to ListBox::Row from which the appropriate row is fetched when the list is populated.

I'd also prefer

Code: Select all

DesignType BuildableItem::GetDesignType()
to

Code: Select all

bool BuildabileItem::IsDesignType(DesignType design_type)
as the former is more easily usable for a variety of purposes and is more consistent with the rest of the codebase.

Otherwise, I'm not sure what the point of your point is... but it's probably redundant and potentially confusing to have an enum DesignType in addition to having subclasses of BuildableItem where the type of the subclass provides the same information.

next_ghost
Krill Swarm
Posts: 12
Joined: Sun Jul 22, 2007 7:48 pm
Location: Czech republic

Re: The Help Thread

#272 Post by next_ghost »

Let's continue here.

WebSnozz
Krill Swarm
Posts: 12
Joined: Sat Jul 07, 2007 1:26 am
Location: USA

Re: The Help Thread

#273 Post by WebSnozz »

Geoff the Medio wrote: Again, see the README.txt. Once installed, using scons just to get GG and FreeOrion compiled should be trivially simple.
I installed python to C:\Python25 and added it to the path environment variable, then installed scons. I used tortoise to update freeorion and GG. Then from the VS 2005 Command Prompt I performed the below, but it seems to be having problems. Following that is the config.log from the FreeOrion\GG directory showing it is having problems finding boost/shared_ptr.hpp. One instance of this file is located in at this location:
C:\Subversion\FreeOrion\FreeOrion_SDK\Boost\include\boost-1_34\boost

Code: Select all

C:\Subversion\FreeOrion\FreeOrion_SDK\FreeOrion\GG>scons configure
scons: Reading SConscript files ...
Configuring for WIN32 system...
Checking for C++ header file boost/shared_ptr.hpp... no
Boost configuration... (cached) no
C:\Subversion\FreeOrion\FreeOrion_SDK\FreeOrion\GG>scons install
scons: Reading SConscript files ...
Configuring for WIN32 system...
Checking for C++ header file boost/shared_ptr.hpp... no
Boost configuration... (cached) no
C:\Subversion\FreeOrion\FreeOrion_SDK\FreeOrion\GG>cd ..

C:\Subversion\FreeOrion\FreeOrion_SDK\FreeOrion>scons configure
scons: Reading SConscript files ...
Configuring for WIN32 system...
Checking for pkg-config... no
Checking for C++ header file boost/shared_ptr.hpp... yes
Checking Boost version >= 1.34... (cached) yes
Boost configuration... (cached) ok
Checking for sdl-config... (cached) no
Checking for C header file SDL\SDL.h... yes
Checking SDL version >= 1.2.7... (cached) yes
SDL configuration... (cached) yes
Checking freetype2 version >= 2.1.2... (cached) yes
Checking for C header file ft2build.h... yes
Checking DevIL version >= 1.6.1... (cached) yes
Checking for C header file IL/il.h... yes
Checking for C header file IL/ilu.h... yes
Checking for C header file IL/ilut.h... yes
Checking for DevIL OpenGL support... yes
Checking for C header file gvc.h... yes
Checking log4cpp version == 0.3.4b... (cached) yes
Checking for C++ header file log4cpp/Category.hh... yes
Configuration successful... (cached) yes
C:\Subversion\FreeOrion\FreeOrion_SDK\FreeOrion>scons
scons: Reading SConscript files ...
Using previous successful configuration; if you want to re-run the configuration
 step, run "scons configure".
IOError: [Errno 2] No such file or directory: '..\\lib\\GiGi.dll':
  File "C:\Subversion\FreeOrion\FreeOrion_SDK\FreeOrion\SConstruct", line 565:
    shutil.copy(os.path.join('..', 'lib', 'GiGi.dll'), '.')
  File "C:\Python25\lib\shutil.py", line 80:
    copyfile(src, dst)
  File "C:\Python25\lib\shutil.py", line 46:
    fsrc = open(src, 'rb')
C:\Subversion\FreeOrion\FreeOrion_SDK\FreeOrion>

Code: Select all

file C:\Subversion\FreeOrion\FreeOrion_SDK\FreeOrion\GG\SConstruct,line 202:
	Configure(confdir = .sconf_temp)
scons: Configure: Checking for C++ header file boost/shared_ptr.hpp... 
.sconf_temp\conftest_0.cpp <-
  |
  |#include "boost/shared_ptr.hpp"
  |
  |
cl /nologo /TP /c .sconf_temp\conftest_0.cpp /Fo.sconf_temp\conftest_0.obj
conftest_0.cpp
.sconf_temp\conftest_0.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
I'm excited!

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

Re: The Help Thread

#274 Post by Geoff the Medio »

When was the last time you updated the SDK you downloaded?

What's in your GG options.cache ?

WebSnozz
Krill Swarm
Posts: 12
Joined: Sat Jul 07, 2007 1:26 am
Location: USA

Re: The Help Thread

#275 Post by WebSnozz »

Geoff the Medio wrote:When was the last time you updated the SDK you downloaded?

What's in your GG options.cache ?
Updated it last night before running scons.

options.cache is empty.
I'm excited!

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

Re: The Help Thread

#276 Post by Geoff the Medio »

WebSnozz wrote:options.cache is empty.
The options.cache in GG should be:

Code: Select all

prefix = '..\\..'
with_boost = '..\\..\\Boost'
with_boost_include = '..\\..\\Boost\\include\\boost-1_34'
with_sdl = '..\\..'
with_ft = '..\\..'
with_devil = '..\\..'
Perhaps it's missing from the SDK?
[edit]
I downloaded the SDK just now, and it has options.cache with the above contents.

WebSnozz
Krill Swarm
Posts: 12
Joined: Sat Jul 07, 2007 1:26 am
Location: USA

Re: The Help Thread

#277 Post by WebSnozz »

Geoff the Medio wrote:
WebSnozz wrote:options.cache is empty.
The options.cache in GG should be:

Code: Select all

prefix = '..\\..'
with_boost = '..\\..\\Boost'
with_boost_include = '..\\..\\Boost\\include\\boost-1_34'
with_sdl = '..\\..'
with_ft = '..\\..'
with_devil = '..\\..'
Perhaps it's missing from the SDK?
[edit]
I downloaded the SDK just now, and it has options.cache with the above contents.
I checked the original copy as I downloaded it, and it has options.cache with something in it. However, after I do an svn update, it is no longer there. The log of actions taken during updating doesn't mention options.cache, so I'm not sure what happens to it. Tortoise does not put a check mark icon on the file(the only options tortoise provides is to add the file). I guess that means it's not associated with the repository?

Anyhow, the workaround for me was to make a copy of the sdk as downloaded, use the Relocate option to point to the correct domain name, do an svn update, then copy the options.cache from the oringal download into the updated version.
I'm excited!

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: The Help Thread

#278 Post by kroddn »

I don't think you need a options.cache, the parameters to "scons configure" are saved there. The "default" values should not be in the options.cache but in the scons-scripts themselves, so this file should not be included in svn.

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

Re: The Help Thread

#279 Post by Geoff the Medio »

kroddn wrote:I don't think you need a options.cache, the parameters to "scons configure" are saved there. The "default" values should not be in the options.cache but in the scons-scripts themselves, so this file should not be included in svn.
It's not included in SVN, but it is included in the FreeOrion Windows SDK, so that an SDK user shouldn't have to provide any parameters, and can just run "scons configure" and have it work immediately.

EoD
Space Krill
Posts: 4
Joined: Wed Aug 02, 2006 9:38 am

Re: The Help Thread

#280 Post by EoD »

Is there are file with default values for linux? Especially for Ubuntu. I think this may an easy fix for many people with such problems...

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

Re: The Help Thread

#281 Post by Geoff the Medio »

If you provide one, there will be.

EoD
Space Krill
Posts: 4
Joined: Wed Aug 02, 2006 9:38 am

Re: The Help Thread

#282 Post by EoD »

Is in Ubuntu actually an option file required?
I don't get boost 1.34 working with an Ubuntu version prior to GustyGibbon (7.10 already includes the new boost libs), so i can't really anwser the question myself...

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: The Help Thread

#283 Post by kroddn »

Take a look at this:
viewtopic.php?f=24&t=1828

User avatar
General_Zaber
Space Kraken
Posts: 130
Joined: Wed Jan 09, 2008 6:43 am
Location: Iserlohn Fortress

Re: The Help Thread

#284 Post by General_Zaber »

Quick question:

I want to replace the python25.dll with a python26.dll. I have Python 2.6.2 installed but I can't find python26.dll there.
The enemy is retreating! As always, there is no cuteness about them. Dammit

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

Re: The Help Thread

#285 Post by Geoff the Medio »

General_Zaber wrote:Quick question:

I want to replace the python25.dll with a python26.dll. I have Python 2.6.2 installed but I can't find python26.dll there.
That's not a question. (What do you want to know?)

Post Reply