Jump to content

aiaf's Blog

  • entries
    11
  • comments
    4
  • views
    7,354

Leadwerks and gcc 5.2.1 (regarding c++ abi)


aiaf

2,453 views

 Share

I just updated my laptop to ubuntu 15.10 (from 15.04).

 

And got into some intereasting issues.

 

I rebuild my game with the new compiler, and it doesnt link anymore.

 

I got a bunch of undefined references like below:

 

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

 

This didnt make any sense, the program was linking just fine with the previous version of gcc (4.9.2).

 

After some digging i found the explanation:

 

https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html

 

It seems in gcc 5.1 a new abi was introduced, and the Leadwerks static lib was built with some previous version causing the above problems.

 

The solution i used was to add this macro at the begining of every cpp file in the project (in case of linux)

 

#define _GLIBCXX_USE_CXX11_ABI 0

 

Ths forces the use of the old abi and the game links just fine.

 

I suppose this wont be really a problem for Leadwerks, but was annoying to me.

 

Regards

  • Upvote 4
 Share

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   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...