Jump to content
mbarhon

Compile problem on Ubuntu 16.04 using CodeBlocks C++

Recommended Posts

Hi all,

 

I have problem compile a blank Leadwerks C++ project on ubuntu 16.04(64Bit) with CodeBlocs(ver.16.01). Before i used CB on Ubuntu 15.10 without problems. Strange is that after fresh install on ubuntu 16.04 I have to install also all dependecy libraries manualy (libgl1-mesa-dev...etc) even it is installed from Steam.

 

After installation of libraries that linker wanted i got:

 

g++ -o ../../SpaceWars.debug ../../Source/App.o ../../Source/main.o /media/mbarhon/53229DC13D856ACD/mbarhon/Steam/steamapps/common/Leadwerks/Library/Linux/Debug/Leadwerks.a -ldl -lopenal -lGL -lGLU /media/mbarhon/53229DC13D856ACD/mbarhon/Steam/steamapps/common/Leadwerks/Library/Linux/libluajit.a ../../libsteam_api.so -lX11 -lpthread

undefined reference to `Leadwerks::FileSystem::StripAll(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

 

and this repeats for every line contain any function or varible from namespace Leadwerks.

 

I tried to change a linker settings (directory of leadwerks lib ), but without success.

Maybe I forgot to install some lib?

 

I'm little stuck at this moment. Have someone any idea where can be the problem?

Share this post


Link to post

I have some progress,

 

when I changed path of leadwerks libraries to "relative" instead of whole path from root, it is compile, but have another problem, maybe with architecture:

 

../../../../../../Steam/steamapps/common/Leadwerks/Library/Linux/libsteam_api.so: error adding symbols: File in wrong format

Share this post


Link to post

Hi guys,

 

I'm still stuck, nobody have some advice? I tried install leadwerks on another computer with fresh ubuntu 16.04, Steam, CodeBlocks and Leadwerks(from steam) and the problem is still same.

Share this post


Link to post

Ubuntu 14 LTS uses GCC 4.9.1 and Ubuntu 16 uses GCC 5.3.1, did you try downgrading to 4.9.1 (I don't know if you can)? It's a bad idea to mix different versions of GCC with Leadwerks because a number of function signatures use STL (mostly std::string but I've seen std::vector a few times), the underlying implementation of STL has likely changed between GCC releases.

Share this post


Link to post

Ubuntu 14 LTS uses GCC 4.9.1 and Ubuntu 16 uses GCC 5.3.1, did you try downgrading to 4.9.1 (I don't know if you can)? It's a bad idea to mix different versions of GCC with Leadwerks because a number of function signatures use STL (mostly std::string but I've seen std::vector a few times), the underlying implementation of STL has likely changed between GCC releases.

 

Hi, thank you for advice! I will try it

Share this post


Link to post

Hi all,

 

thanks to advice of thehankinator I have found the solution. It's simple, just install gcc version 4.9 in ubuntu 16.04..

 

sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9

 

 

 

...and after it, open CodeBlocks and set path for another version of compiler (Settings->Compiler->Toolchain Executables)

Share this post


Link to post

I assumed this was because the precompiled lib was built with a different version of GCC but this is happening when I compile the lib on the current version of GCC in Ubuntu 16.04.

Share this post


Link to post

-D_GLIBCXX_USE_CXX11_ABI=1 i have this in CXXFLAGS, if this is 0 you get tons of error about abi. (thanks @aiaf )

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...