Compiling/linking nightmare on SuSE

For those having trouble installing/running the game or to report a bug

Moderator: Staff

Auris
Newbie
Posts: 7
Joined: Fri Jun 22, 2007 10:45 pm
Location: Germany

Compiling/linking nightmare on SuSE

Postby Auris » Fri Jun 22, 2007 11:55 pm

(1)When I tried to compile the source for the 0.2 Demo (configure went through fine after all dependecies where installed) I got errors, mostly unknown SDL defines (can't recall anymore which but I modified the source to fix them). Then I looked up one of the errors in the forum and read that SDL > 1.2.10 is needed (had only 1.2.8), so I installed the latest SDL and all errors where gone - I thought.

:arrow: If possible please update the README file with exact versionsnumbers of the libs needed. Or at least put a link to the wiki where the most recent numbers are. Another solution whould be to let them check by the configure script (no idea if it's really possible).


(2)Next one I had at first no idea how to fix this:

Code: Select all

if g++ -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/boost-1_34/ -I/usr/include/SDL -I./src -I./src/engine -I./src/engine/audio -I./src/engine/video -I./src/global -I./src/modes -I./src/modes/battle -I./src/modes/boot -I./src/modes/map -I./src/modes/menu -I./src/modes/shop -DDATADIR=\"/usr/local/share\" -I/usr/X11R6/include -I/usr/X11R6/include  -Wall -O3 -MT defs.o -MD -MP -MF ".deps/defs.Tpo" -c -o defs.o `test -f 'src/defs.cpp' || echo './'`src/defs.cpp; \
then mv -f ".deps/defs.Tpo" ".deps/defs.Po"; else rm -f ".deps/defs.Tpo"; exit 1; fi
/usr/local/include/luabind/detail/call.hpp: In static member function `static
   int luabind::detail::returns<void>::call(void (C::*)(A0, A1), WrappedClass*,
   lua_State*, Policies*) [with C = const hoa_map::private_map::MapObject,
   WrappedClass = hoa_map::private_map::MapObject, Policies =
   luabind::detail::null_type, A0 = uint16&, A1 = float&]':
/usr/local/include/luabind/detail/call.hpp:420:   instantiated from `int luabind::detail::call(R (T::*)(A0, A1) const, WrappedClass*, lua_State*, const Policies*) [with T = hoa_map::private_map::MapObject, WrappedClass = hoa_map::private_map::MapObject, Policies = luabind::detail::null_type, R = void, A0 = uint16&, A1= float&]'
/usr/local/include/luabind/class.hpp:210:   instantiated from `int luabind::detail::mem_fn_callback<Fn, Class, Policies>::operator()(lua_State*) const [with Fn= void (hoa_map::private_map::MapObject::*)(uint16&, float&) const, Class = hoa_map::private_map::MapObject, Policies = luabind::detail::null_type]'
/usr/local/include/boost-1_34/boost/function/function_template.hpp:134:   instantiated from `static R boost::detail::function::function_obj_invoker1<FunctionObj, R, T0>::invoke(boost::detail::function::function_buffer&, T0) [with FunctionObj = luabind::detail::mem_fn_callback<void (hoa_map::private_map::MapObject::*)(uint16&, float&) const, hoa_map::private_map::MapObject, luabind::detail::null_type>, R = int, T0 = lua_State*]'
/usr/local/include/boost-1_34/boost/function/function_template.hpp:368:   instantiated from `void boost::detail::function::basic_vtable1<R, T0, Allocator>::init(FunctionObj, boost::detail::function::function_obj_tag) [with FunctionObj = luabind::detail::mem_fn_callback<void (hoa_map::private_map::MapObject::*)(uint16&, float&) const, hoa_map::private_map::MapObject, luabind::detail::null_type>, R= int, T0 = lua_State*, Allocator = std::allocator<boost::function_base>]'
/usr/local/include/boost-1_34/boost/function/function_template.hpp:298:   instantiated from `void boost::detail::function::basic_vtable1<R, T0, Allocator>::init(F) [with F = luabind::detail::mem_fn_callback<void (hoa_map::private_map::MapObject::*)(uint16&, float&) const, hoa_map::private_map::MapObject, luabind::detail::null_type>, R = int, T0 = lua_State*, Allocator = std::allocator<boost::function_base>]'
/usr/local/include/boost-1_34/boost/function/function_template.hpp:277:   instantiated from `boost::detail::function::basic_vtable1<R, T0, Allocator>::basic_vtable1(F) [with F = luabind::detail::mem_fn_callback<void (hoa_map::private_map::MapObject::*)(uint16&, float&) const, hoa_map::private_map::MapObject, luabind::detail::null_type>, R = int, T0 = lua_State*, Allocator = std::allocator<boost::function_base>]'
/usr/local/include/boost-1_34/boost/function/function_template.hpp:655:   instantiated from `void boost::function1<R, T0, Allocator>::assign_to(Functor) [with Functor = luabind::detail::mem_fn_callback<void (hoa_map::private_map::MapObject::*)(uint16&, float&) const, hoa_map::private_map::MapObject, luabind::detail::null_type>, R = int, T0 = lua_State*, Allocator = std::allocator<boost::function_base>]'
/usr/local/include/boost-1_34/boost/function/function_template.hpp:513:   instantiated from `boost::function1<R, T0, Allocator>::function1(Functor, typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type) [with Functor = luabind::detail::mem_fn_callback<void (hoa_map::private_map::MapObject::*)(uint16&, float&) const, hoa_map::private_map::MapObject, luabind::detail::null_type>, R = int, T0 = lua_State*, Allocator = std::allocator<boost::function_base>]'
/usr/local/include/luabind/class.hpp:1218:   instantiated from `luabind::class_<T, X1, X2, X3>& luabind::class_<T, X1, X2, X3>::virtual_def(const char*, const F&, const Policies&, luabind::detail::null_type, mpl_::bool_<true>) [with F = void (hoa_map::private_map::MapObject::*)(uint16&, float&) const, Policies = luabind::detail::null_type, T = hoa_map::private_map::MapObject, X1 = luabind::detail::unspecified, X2 = luabind::detail::unspecified, X3 = luabind::detail::unspecified]'
/usr/local/include/luabind/class.hpp:866:   instantiated from `luabind::class_<T, X1, X2, X3>& luabind::class_<T, X1, X2, X3>::def(const char*, F) [with F = void (hoa_map::private_map::MapObject::*)(uint16&, float&) const, T = hoa_map::private_map::MapObject, X1 = luabind::detail::unspecified, X2 = luabind::detail::unspecified, X3 = luabind::detail::unspecified]'
src/defs.cpp:417:   instantiated from here
/usr/local/include/luabind/detail/call.hpp:278: error: no matching function for
   call to `luabind::detail::pointer_converter<luabind::detail::lua_to_cpp>::
   apply(lua_State*&,
   luabind::detail::by_const_pointer<hoa_map::private_map::MapObject>, int)'


I'm not really sure how I came to the idea but I thought my gcc (3.3.4) might be too old because I the errors it gave to me before and I fixed it looked like that might be the problem. So I compiled the latest gcc and it worked!

:arrow: So my suggestion would be either to install an older gcc and make the next release work with it too or to say in the README file that at least gcc > x.x.x is needed to compile the source.


(3)Now there came linking issues:
My quite old SuSE system is rpm based and shippes with gcc 3.3.4 and which uses stdc++.so.5 but the newer gcc 4.2.0 I installed links with .6. After compiling the binary it gave me a warning like:

Code: Select all

/usr/bin/ld: warning: libstdc++.so.5, needed by libGLU.so, may conflict with libstdc++. so.6

The game started and segmetation faulted pretty quick. Compiling both in or only libstdc++.so.5 in didn't help much. It gave a lot of free corruption errors and segfauted too. Because I didn't want to update my whole system library to the libstdc++6 and maybe break it, I came to the idea to link all libs that needed the old stddc++ statically in (by using /usr/lib/libXY.a instead of -lXY in the Makefile). I had to add all deps statically too and in the right order and then, I came finally to the last error:

Code: Select all

new_g++  -Wall -O3   -o allacrost  main.o main_options.o defs.o utils.o system.o input.o mode_manager.o script.o socket.o audio.o audio_sound.o audio_music.o draw.o effects.o fade.o gui.o image.o interpolator.o menu_window.o option.o particle_effect.o particle_manager.o particle_system.o shake.o tex_mgmt.o text.o textbox.o video.o global.o global_actors.o global_objects.o global_skills.o battle.obattle_actors.o boot.o boot_menu.o boot_credits.o boot_welcome.o map.o map_zones.o map_actions.o map_dialogue.o map_objects.o menu.o menu_views.o pause.o quit.o scene.o shop.o shop_windows.o  -lm -lluabind -llualib -llua -lSDL -lSDL_net -lSDL_ttf /usr/lib/libSDL_mixer.a /usr/lib/libasound.a /usr/lib/libvorbisfile.a /usr/lib/libvorbis.a /usr/lib/libogg.a /usr/lib/libsmpeg.a -ljpeg -lpng /usr/lib/libGLU.a -lGL -lX11 -lgcc -L/usr/X11R6/lib -L/usr/X11R6/lib
/usr/local/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libluabind.a(class.o)(.gnu.linkonce.t._ZNSt14__simple_allocISt13_Rb_tree_nodeISt4pairIKPKcN7luabind6detail9class_rep8callbackEEESt24__default_alloc_templateILb1ELi0EEE10deallocateEPSA_j+0x22): In function `std::__simple_alloc<std::_Rb_tree_node<std::pair<char const* const, luabind::detail::class_rep::callback> >, std::__default_alloc_template<true, 0> >::deallocate(std::_Rb_tree_node<std::pair<char const* const, luabind::detail::class_rep::callback> >*, unsigned int)':
/usr/local/include/boost-1_34/boost/function/function_template.hpp:647: undefined reference to `std::__default_alloc_template<true, 0>::deallocate(void*, unsigned int)'

[lots of similar errors cutted]

/usr/local/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../
libluabind.a(class_registry.o)(.gnu.linkonce.t._ZNSt14__simple_allocISt13_Rb_tree_nodeISt4pairIKPKSt9type_infoPN7luabind6detail9class_repEEESt24__default_alloc_templateILb1ELi0EEE8allocateEj+0x28): In function `std::__simple_alloc<std::_Rb_tree_node<std::pair<std::type_info const* const, luabind::detail::class_rep*> >, std::__default_alloc_template<true, 0> >::allocate(unsigned int)':
../luabind/detail/garbage_collector.hpp:47: undefined reference to `std::__default_alloc_template<true, 0>::allocate(unsigned int)'


Which was solved by rebuliding the luabind.a with the new gcc. The game now runs fine and I will submit my impressions when I have time. I hope this at least helps users who browse the forums esp. with older systems to get the game installed and save a lots of time.
If there was an easier way I missed please let me know :eyebrow:
User avatar
gorzuate
Developer
Posts: 2575
Joined: Thu Jun 17, 2004 3:03 am
Location: Hermosa Beach, CA
Contact:

Postby gorzuate » Sat Jun 23, 2007 1:35 am

Yikes :ohnoes:

Thanks for the heads up on the configure script and SDL. I will try to see if it can check for specific versions.

Also thanks for the defs.cpp solution. I'm having the same problem on one of my own boxes and had no idea why it was happening in the first place. I guess I'll try upgrading gcc.

We will be sure to update the README file too. Sorry we missed that :angel:

Good job on getting the linking to work :bow:

At least now we know that luabind doesn't work with older versions of gcc.
Image
Winter Knight
Contributor
Posts: 304
Joined: Fri Sep 21, 2007 12:35 pm
Contact:

Postby Winter Knight » Sat Sep 22, 2007 12:06 am

gorzuate wrote:At least now we know that luabind doesn't work with older versions of gcc.


It doesn't work with newer versions either. See this thread: http://www.allacrost.org/forum/viewtopic.php?p=22284
I ran into a segfault, similar to what Auris had at one point in his ordeal. I solved it by compiling luabind with the same g++ version that I compiled allacrost with. It is possible that this is what solved the problem for Auris; not that he used a newer version of g++, but that he used the same g++ version to compile both allacrost and luabind.

Perhaps allacrost and luabind have to be compiled with the same version of g++.

Return to “Technical Issues”

Who is online

Users browsing this forum: No registered users and 4 guests