Link all libraries into the executable (actually: make a deploy folder)
-
if you have all your so files in same directory as your executable, it will find those libraries.
On Windows, yes, but not on Linux. You have to explicitly point the loader to the current working directory.
@kshegunov I thought . is default added into rpath. Yes that is build chain specific thing and should not consider as a global thing.
-
@kshegunov Thanks for taking the time to break it down for me, I appreciate it. So I'll try to sort the .so file list I made earlier:
These files should be in my project directory:
platforms/libqxcb.so libsfml-system.so.2.3 libsfml-network.so.2.3 libQt5Widgets.so.5 libQt5Gui.so.5 libQt5Core.so.5
As well as these files (because of the SFML libraries)
libfreetype.so.6 libX11.so.6 libxcb.so.1 libX11-xcb.so.1 libxcb-glx.so.0 libxcb-dri2.so.0 libxcb-dri3.so.0 libxcb-present.so.0 libxcb-sync.so.1 libGL.so.1 libpthread.so.0
As well as these files (because of the Qt libraries)
libicudata.so.55 libicui18n.so.55 libicuuc.so.55
And these files should not be included in my project directory:
libstdc++.so.6 libm.so.6 libgcc_s.so.1 libc.so.6 librt.so.1 libgobject-2.0.so.0 libglib-2.0.so.0 libgobject-2.0.so.0 libpng12.so.0 libharfbuzz.so.0 libz.so.1 libpcre16.so.3 libdl.so.2 libffi.so.6 libpcre.so.3 libgraphite2.so.3 libexpat.so.1 libglapi.so.0 libXext.so.6 libXdamage.so.1 libXfixes.so.3 libxshmfence.so.1 libXxf86vm.so.1 libdrm.so.2 libXau.so.6 libXdmcp.so.6
Did I get something wrong in any list? Anyway, I tried that and compiled my project successfully. When I run it however, I still get the old openGL message:
./my_app: symbol lookup error: /home/lol/Documents/Coding/Union/libQt5Gui.so.5: undefined symbol: glGetString
which I never had before I started to mess with .so files. I'm not sure how to determine which .so file is needed for
glGetString
. -
@kshegunov I thought . is default added into rpath. Yes that is build chain specific thing and should not consider as a global thing.
is default added into rpath. Yes that is build chain specific thing and should not consider as a global thing.
Nope, by default
rpath
is not set.Leave those to the system (don't copy them with your executable):
libfreetype
- a fonts librarylibX11*
- X11 librarieslibxcb*
- more X11 librarieslibGL
- OpenGL librarylibpthread
- thread support
Copy
libQt*
(those that you need, and you seem to have done that) andlibic*
+ the platform plugin (I also see it in your project folder).I'm not sure how to determine which .so file is needed for glGetString.
This would be
libGL.so
, however if it's installed on your system it should be known to the loader. One thing that might be interfering with that would be some binary incompatibility - either a different compiler was used (unlikely to cause a problem) or a very different version of the library. Did you make sure you have libGL installed on your system?Kind regards.
-
Well I googled the issue, I added
-lGL -lstdc++ -lc -lm -lglut -lGLU
to LIBS in the .pro file but I still get the error. I really don't know what's happening here :Slibgl1-mesa-dev is already the newest version.
-
Well I googled the issue, I added
-lGL -lstdc++ -lc -lm -lglut -lGLU
to LIBS in the .pro file but I still get the error. I really don't know what's happening here :Slibgl1-mesa-dev is already the newest version.