Jump to content

Compile problem on Ubuntu 16.04 using CodeBlocks C++


mbarhon
 Share

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

  • Upvote 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)

  • Upvote 3
Link to comment
Share on other sites

  • 1 year later...

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.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...