[Solved] Error while compiling svn-sources

Started by ElFuego, 24 October 2008, 09:37:47

ElFuego

Hi all,

first to the devs: Great work & THX!!! I had some really nice ours with the game.

But now to my problem: I downloaded the sources (description from wiki used) from the svn-repository (using eclipse, the whole trunk folder with the option head revision). Then i made the normal steps ./autogen.sh, ./configure and jam in the mk/linux dir. While compiling i got the following error:

C++ ./build/i686-pc-linux-gnu/optimize/glest_game/gui/gui.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/gui/display.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/gui/selection.o
MkDir1 ./build/i686-pc-linux-gnu/optimize/glest_game/main
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/main/battle_end.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/main/main.o
glest_game/main/main.cpp: In function ‘int Glest::Game::glestMain(int, char**)’:
glest_game/main/main.cpp:120: error: cannot declare variable ‘exceptionHandler’ to be of abstract type ‘Glest::Game::ExceptionHandler’
glest_game/main/main.cpp:37: note:   because the following virtual functions are pure within ‘Glest::Game::ExceptionHandler’:
glest_game/../shared_lib/include/../include/platform/sdl/platform_util.h:80: note:      virtual void Shared::Platform::PlatformExceptionHandler::handle(std::string)

    g++ -c -o ./build/i686-pc-linux-gnu/optimize/glest_game/main/main.o  -DPACKAGE_NAME="glest" -DPACKAGE_TARNAME="glest" -DPACKAGE_VERSION="3.1.2" -DPACKAGE_STRING="glest 3.1.2" -DPACKAGE_BUGREPORT="matze@braunis.de" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DUSE_POSIX_SOCKETS= -DX11_AVAILABLE=1 -DHAVE_GLOB_H=1 -DHAVE_SYS_IOCTL_H=1 -DUSE_SDL= -DHAVE_PTHREAD=1 -I. -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -pthread -pthread     -I/usr/include/lua5.1 -Iglest_game/../shared_lib/include/../include/platform/sdl -Iglest_game/../shared_lib/include/../include/platform/posix -Iglest_game/../shared_lib/include/../include/util -Iglest_game/../shared_lib/include/../include/graphics -Iglest_game/../shared_lib/include/../include/graphics/gl -Iglest_game/../shared_lib/include/../include/sound -Iglest_game/../shared_lib/include/../include/sound/openal -Iglest_game/../shared_lib/include/../include/xml -Iglest_game/../shared_lib/include/../include/glew -Iglest_game/../shared_lib/include/../include/lua -Iglest_game/. -Iglest_game/ai -Iglest_game/facilities -Iglest_game/game -Iglest_game/global -Iglest_game/graphics -Iglest_game/gui -Iglest_game/main -Iglest_game/menu -Iglest_game/network -Iglest_game/sound -Iglest_game/type_instances -Iglest_game/types -Iglest_game/world   -O3 -DNDEBUG glest_game/main/main.cpp

...failed C++ ./build/i686-pc-linux-gnu/optimize/glest_game/main/main.o ...
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/main/program.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/main/intro.o
MkDir1 ./build/i686-pc-linux-gnu/optimize/glest_game/menu
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/menu/menu_state_about.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/menu/menu_background.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/menu/menu_state_new_game.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/menu/menu_state_root.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/menu/main_menu.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/menu/menu_state_graphic_info.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/menu/menu_state_join_game.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/menu/menu_state_options.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/menu/menu_state_custom_game.o
...on 100th target...
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/menu/menu_state_scenario.o
MkDir1 ./build/i686-pc-linux-gnu/optimize/glest_game/network
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/network/client_interface.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/network/connection_slot.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/network/network_manager.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/network/server_interface.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/network/network_interface.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/network/network_message.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/network/network_types.o
MkDir1 ./build/i686-pc-linux-gnu/optimize/glest_game/sound
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/sound/sound_renderer.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/sound/sound_container.o
MkDir1 ./build/i686-pc-linux-gnu/optimize/glest_game/type_instances
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/type_instances/command.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/type_instances/unit.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/type_instances/faction.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/type_instances/object.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/type_instances/resource.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/type_instances/upgrade.o
MkDir1 ./build/i686-pc-linux-gnu/optimize/glest_game/types
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/types/tech_tree.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/types/object_type.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/types/command_type.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/types/skill_type.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/types/unit_type.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/types/damage_multiplier.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/types/faction_type.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/types/upgrade_type.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/types/resource_type.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/types/element_type.o
MkDir1 ./build/i686-pc-linux-gnu/optimize/glest_game/world
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/world/scenario.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/world/unit_updater.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/world/tileset.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/world/surface_atlas.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/world/map.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/world/water_effects.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/world/time_flow.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/world/world.o
C++ ./build/i686-pc-linux-gnu/optimize/glest_game/world/minimap.o
...skipped glest for lack of <T!glest_game!>main/main.o...
...failed updating 1 target(s)...
...skipped 1 target(s)...
...updated 138 target(s)...

Do i have downloaded the wrong sources? Or do i need to apply a patch? Or what else could have gone wrong?

Many thanks in advance.

Yggdrasil

You need this patch. It got lost in forum crash.

Index: source/shared_lib/include/platform/sdl/platform_util.h
===================================================================
--- source/shared_lib/include/platform/sdl/platform_util.h      (Revision 177)
+++ source/shared_lib/include/platform/sdl/platform_util.h      (Arbeitskopie)
@@ -77,7 +77,7 @@
 public:
        virtual ~PlatformExceptionHandler() {}
        void install(string dumpFileName) {}
-       virtual void handle(string dumpFileName) = 0;
+       virtual void handle() = 0;
 };

 // =====================================================

Save in file.patch and apply in trunk with:
patch -p0 <file.patch

btw, the linux binary from titi is build from the latest svn revision. If you just need a binary, use that one.
//http://www.titusgames.de/glestbin/glest.bin_3.2.beta3.tar.gz
The post from titi seems also lost. Here is an older post:
//http://glest.org/glest_board/viewtopic.php?f=11&t=3648

ElFuego

THX for the fast help. I'll try it as soon as i have some time left. I want to compile it by myself so that i can look at the code and maybe can help develope the game in the near future.

@EDIT: I have now managed to compile it. The patch wasn't working, but i changed it by hand.

hailstone

QuoteI have now managed to compile it.
Good to know.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

deathguppie

oh crud balls..  

This fixed one problem for me.. but not all of them

C++ ./build/x86_64-unknown-linux-gnu/optimize/shared_lib/sources/util/conversion.o                
shared_lib/sources/util/conversion.cpp: In function ‘int Shared::Util::strToInt(const std::string&)’:
shared_lib/sources/util/conversion.cpp:37: error: ‘strtol’ was not declared in this scope            
shared_lib/sources/util/conversion.cpp: In function ‘float Shared::Util::strToFloat(const std::string&)’:
shared_lib/sources/util/conversion.cpp:49: error: ‘strtod’ was not declared in this scope                
shared_lib/sources/util/conversion.cpp: In function ‘bool Shared::Util::strToInt(const std::string&, int*)’:
shared_lib/sources/util/conversion.cpp:73: error: ‘strtol’ was not declared in this scope                  
shared_lib/sources/util/conversion.cpp: In function ‘bool Shared::Util::strToFloat(const std::string&, float*)’:
shared_lib/sources/util/conversion.cpp:83: error: ‘strtod’ was not declared in this scope                      

    g++ -c -o ./build/x86_64-unknown-linux-gnu/optimize/shared_lib/sources/util/conversion.o  -DPACKAGE_NAME="glest" -DPACKAGE_TARNAME="glest" -DPACKAGE_VERSION="3.1.2" -DPACKAGE_STRING="glest 3.1.2" -DPACKAGE_BUGREPORT="matze@braunis.de" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DUSE_POSIX_SOCKETS= -DX11_AVAILABLE=1 -DHAVE_GLOB_H=1 -DHAVE_SYS_IOCTL_H=1 -DUSE_SDL= -DHAVE_PTHREAD=1 -I. -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -pthread -pthread     -I/usr/include/lua5.1 -Ishared_lib/sources/../include/platform/sdl -Ishared_lib/sources/../include/platform/posix -Ishared_lib/sources/../include/util -Ishared_lib/sources/../include/graphics -Ishared_lib/sources/../include/graphics/gl -Ishared_lib/sources/../include/sound -Ishared_lib/sources/../include/sound/openal -Ishared_lib/sources/../include/xml -Ishared_lib/sources/../include/glew -Ishared_lib/sources/../include/lua   -O3 -DNDEBUG shared_lib/sources/util/conversion.cpp                                                

...failed C++ ./build/x86_64-unknown-linux-gnu/optimize/shared_lib/sources/util/conversion.o ...

...and the inevitable..

...skipped libglestlib.a for lack of libglestlib.a(conversion.o)...  

..which means..

...skipped glest for lack of libglestlib.a...


so the problem seems to be in conversion.cpp   ... this is where I wish I new C++..

Yggdrasil

You need to include stdlib.

#include <cstdlib>
Add it after the other includes nearly at the top of 'conversion.cpp', e.g. under cstdio.

pompei

Hello, I have the same, maybe it's me who once reported the patch. I just want to say that these should be commited into trunk !! It is very annoying to need to re-fix these errors after doing an svn-update ...

hailstone

Is this a problem in Glest Advanced Engine?
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

martiño

All this stuff should now be fixed in the official SVN, can anyone double check that it compiles fine on Linux?

Yggdrasil

Revision 188 builds and runs fine with gcc 4.2.4.

titi

I checked out and tested Revision 190 (glest 3.2.1?)  today.
It works( no big testing yet) and compiles perfectly in ubuntu 8.04 with gcc version
gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3)



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios