-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking liblxi #115
Comments
Did you add liblxi to the target_link_libraries line in the glscopeclient CMakeLists or just libscopehal? You might need to link it with the application too. |
I did. I now think the issue is not with cmake, it's with the linking command itself. I took the generated link.txt file. It looks like this: /usr/bin/c++ -g -fopenmp -Wall -Wextra -Wuninitialized -Wshadow -Wunsafe-loop-optimizations -Wpedantic -Wcast-align -Wwrite-strings -Wmissing-declarations -Wvla --std=c++11 -mtune=native -rdynamic CMakeFiles/glscopeclient.dir/ChannelPropertiesDialog.cpp.o CMakeFiles/glscopeclient.dir/Framebuffer.cpp.o CMakeFiles/glscopeclient.dir/HistoryWindow.cpp.o CMakeFiles/glscopeclient.dir/MeasurementDialog.cpp.o CMakeFiles/glscopeclient.dir/OscilloscopeWindow.cpp.o CMakeFiles/glscopeclient.dir/Program.cpp.o CMakeFiles/glscopeclient.dir/ProtocolAnalyzerWindow.cpp.o CMakeFiles/glscopeclient.dir/ProtocolDecoderDialog.cpp.o CMakeFiles/glscopeclient.dir/ScopeApp.cpp.o CMakeFiles/glscopeclient.dir/Shader.cpp.o CMakeFiles/glscopeclient.dir/ShaderStorageBuffer.cpp.o CMakeFiles/glscopeclient.dir/Texture.cpp.o CMakeFiles/glscopeclient.dir/Timeline.cpp.o CMakeFiles/glscopeclient.dir/TriggerPropertiesDialog.cpp.o CMakeFiles/glscopeclient.dir/VertexArray.cpp.o CMakeFiles/glscopeclient.dir/VertexBuffer.cpp.o CMakeFiles/glscopeclient.dir/WaveformArea.cpp.o CMakeFiles/glscopeclient.dir/WaveformArea_events.cpp.o CMakeFiles/glscopeclient.dir/WaveformArea_rendering.cpp.o CMakeFiles/glscopeclient.dir/WaveformArea_cairo.cpp.o CMakeFiles/glscopeclient.dir/WaveformGroup.cpp.o CMakeFiles/glscopeclient.dir/main.cpp.o -o glscopeclient -Wl,-rpath,/home/tom/projects/scopehal-cmake/build/lib/scopehal:/home/tom/projects/scopehal-cmake/build/lib/scopemeasurements:/home/tom/projects/scopehal-cmake/build/lib/graphwidget:/home/tom/projects/scopehal-cmake/build/lib/scopeprotocols /usr/lib/x86_64-linux-gnu/liblxi.so ../../lib/scopehal/libscopehal.so ../../lib/scopemeasurements/libscopemeasurements.so -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lglibmm-2.4 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lgio-2.0 -lcairomm-1.0 -lcairo -lsigc-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lsigc-2.0 -lGL -lyaml-cpp ../../lib/xptools/libxptools.a ../../lib/log/liblog.a ../../lib/graphwidget/libgraphwidget.so -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lglibmm-2.4 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lgio-2.0 -lcairomm-1.0 -lcairo -lsigc-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 ../../lib/scopeprotocols/libscopeprotocols.so /usr/local/lib/libffts.a So liblxi is listed as a library, yet it still fails:
I get the same if I replace the bold stuff above with So there is some issue with linking that eludes me. Tom |
I think the problem is the ordering in that command, liblxi.so should come after libscopehal.so (see here for why: https://eli.thegreenplace.net/2013/07/09/library-order-in-static-linking). I don't know how to get CMake to do that though. |
So I don't think it's a CMake issue. When you run For one reason or the other, liblxi is not added to the list. Next is to try to find out why what is... I've already tried recompiling liblxi from source instead of using the liblxi that comes with Ubuntu, but that didn't solve it either. Trying more things... Tom |
Things magically started working after rebooting PC. It think it was a matter of reloading the shared library cache? Closing... |
I trying to create a SCPILxiTransport class, which relies on liblxi for the low level details.
I've updated the scopehal/CMakeLists.txt to add a dependency on liblxi as follows:
libscopehal.so itself compiles fine, but when I try to build the applications, it fails because it doesn't link with liblxi:
This is despite the fact that
CMakeFiles/glscopeclient.dir/link.txt
has the following on the linking command:liblxi has been installed with a simply
apt install liblxi-dev
, and example programs outside of scopehal compile just fine.I'm very new at cmake obviously. Any pointer on how to unblock this?
Tom
The text was updated successfully, but these errors were encountered: