Josh Posted December 15, 2017 Share Posted December 15, 2017 I've updated the CodeBlocks project template and a new project will compile with no issues, but there is a problem linking to the Leadwerks precompiled library. No linking error is shown, but every Leadwerks command the code calls gives an "undefined reference to function..." error. Any idea why this is happening? I just installed the latest version of CodeBlocks on Ubuntu 16.04. Quote 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 More sharing options...
Josh Posted December 15, 2017 Author Share Posted December 15, 2017 I think this has to do with the order the libs are listed in. If I put Leadwerks.a in front of dl then I get an undefined reference to dlclose. If I list it after then all the Leadwerks functions are undefined. https://stackoverflow.com/questions/956640/linux-c-error-undefined-reference-to-dlopen Quote 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 More sharing options...
mbarhon Posted December 30, 2017 Share Posted December 30, 2017 I experiencing the same problem now (In CodeBlock and in CodeLite too) Did you solve this? I have Ubuntu 16.10 with g++ 4.9 compiler. The result with version 4.9 it's probably same like you have: And with g++-6.x compiler: Quote Link to comment Share on other sites More sharing options...
Josh Posted December 31, 2017 Author Share Posted December 31, 2017 -D_GLIBCXX_USE_CXX11_ABI=1 i have this in CXXFLAGS, if this is 0 you get tons of error about abi. (thanks @aiaf ) Quote 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 More sharing options...
mbarhon Posted December 31, 2017 Share Posted December 31, 2017 Thanks for fast response, but unfortunately this didn't work for me. What version of gcc and libc you used for leadwerks compilation? I guess the problem is that I have different version of g++, same issue that I have a year ago in this thread: https://www.leadwerks.com/community/topic/14663-compile-problem-on-ubuntu-1604-using-codeblocks-c/ Quote Link to comment Share on other sites More sharing options...
Josh Posted December 31, 2017 Author Share Posted December 31, 2017 I am now using the latest / whatever Ubuntu 16 installs by default. Quote 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 More sharing options...
mbarhon Posted December 31, 2017 Share Posted December 31, 2017 I have latest ubuntu 16 too (16.10), I will try compile the project on virtual with fresh instalation. Quote Link to comment Share on other sites More sharing options...
Josh Posted December 31, 2017 Author Share Posted December 31, 2017 Yeah but I remember you said you switched to GCC 4.9. Quote 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 More sharing options...
mbarhon Posted December 31, 2017 Share Posted December 31, 2017 yes, now I have version 4.9 and 6, but on both of them it end up with error. On 4.9 with "undefined reference" and on 6 with "nonrepresentable section on output". I will try fresh instalation of ubuntu 16.04 in virtual and will see Quote Link to comment Share on other sites More sharing options...
mbarhon Posted December 31, 2017 Share Posted December 31, 2017 So, on virtual machine with latest ubuntu 16.04 and fresh instalation of steam, leadwerks + necessary libraries (libgl1-mesa-dev, libopenal-dev, libcurl4-gnutls-dev) i'm able build the sample project in CodeBlocks and in CodeLite (with some modifications) too... But it looks I'm not able to build Leadwerks projects on Ubuntu 16.10 anymore and have to switch back to Ubuntu 16.04 Quote Link to comment Share on other sites More sharing options...
Josh Posted December 31, 2017 Author Share Posted December 31, 2017 I have not booted into Ubuntu yet but is it possible to see the GCC version on each? That is probably the cause. I prefer x.04 versions because they are more stable. Quote 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 More sharing options...
mbarhon Posted December 31, 2017 Share Posted December 31, 2017 On virtual machine where compilation works is gcc version 5.4.0 and on my machine with 16.10 I have versions 4.9.4, 5.4.1 and 6.3.0 but non of them works. Quote Link to comment Share on other sites More sharing options...
aiaf Posted January 1, 2018 Share Posted January 1, 2018 I think sticking to the ubuntu lts version is best, that's my experience not doing intermediary updates anymore. 16.04 end of life is 2021 still getting updates.Next lts will be 18.04 on april. Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station Link to comment Share on other sites More sharing options...
mbarhon Posted January 1, 2018 Share Posted January 1, 2018 11 minutes ago, aiaf said: I think sticking to the ubuntu lts version is best, that's my experience not doing intermediary updates anymore. 16.04 end of life is 2021 still getting updates.Next lts will be 18.04 on april. Yes, i aggree, it's the best practise, I just didn't expect such problems with compilators... Today I will reinstall it, i have /home dir as separate partition so it will be piece of cake Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.