Linking needs to be fixed on Ubuntu
zacharycarter opened this issue · 6 comments
Trying to link bgfx on ubuntu produces the following error :
Hint: [Link]
Hint: operation successful (71798 lines compiled; 2.779 sec total; 208.863MiB peakmem; Debug Build) [SuccessX]
Hint: /home/zc/projects/frag/examples/desktop/00-hello-world/main [Exec]
../vendor/bgfx/.build/linux64_gcc/bin/libbgfx-shared-libDebug.so: undefined symbol: glXGetFBConfigAttrib
libbgfx-shared-libRelease.so: cannot open shared object file: No such file or directory
could not load: libbgfx-shared-lib(Debug|Release).so
Error: execution of an external program failed: '/home/zc/projects/frag/examples/desktop/00-hello-world/main '
Probably due to linking order / transitive OpenGL dependency.
Let me know if I can help testing anything here!
@anthonyfinch you can indeed!
I believe I have a makefile for bgfx shared that should work.
Here's a gist : https://gist.github.com/zacharycarter/cfd9b242024b1727d3fe6f90241c3f7d
The key lines are :
https://gist.github.com/zacharycarter/cfd9b242024b1727d3fe6f90241c3f7d#file-bgfx-shared-lib-make-L61
(Note - this has to be included in whatever target you're building, the example has it included in all targets.)
This should get things working on ubuntu. I'll patch the version of bgfx frag uses tomorrow for linux to include this fix.
@zacharycarter - once I figured out where to use this file ( ;) ) it worked for me, looks good.
Oh - actually maybe worth mentioning as well - before this worked for me I realised I did not have the header files for glut installed (freeglut3-dev on ubuntu.) Might be worth adding to the docs somewhere which libraries you will need.
@anthonyfinch good call when I get around to working on the docu this section I will add it to the dependencies section for linux.
I have that package and I'm still getting this error