Skip to content
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

Error when linking against libtoxcore: undefined reference to symbol 'crypto_hash_sha256' #599

Closed
anthonybilinski opened this issue Oct 3, 2017 · 4 comments
Labels
P1 High priority packaging Packaging
Milestone

Comments

@anthonybilinski
Copy link

Follow up from qTox/qTox#4695

I'm trying to package to toxcore and qTox. When linking qTox, I get the following error:

[  224s] [ 85%] Linking CXX executable qtox
[  224s] /usr/bin/cmake -E cmake_link_script CMakeFiles/qtox.dir/link.txt --verbose=1
[  224s] /usr/bin/x86_64-linux-gnu-g++   -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security  -std=c++11 -fno-exceptions -fno-rtti -fPIE -Wstrict-overflow -Wstrict-aliasing -fstack-protector-all -Wstack-protector -pthread -pthread   -Wl,-Bsymbolic-functions -Wl,-z,relro -pie -Wl,-z,now -Wl,-z,relro CMakeFiles/qtox.dir/qrc_res.cpp.o CMakeFiles/qtox.dir/qrc_translations.cpp.o CMakeFiles/qtox.dir/qrc_emojione.cpp.o CMakeFiles/qtox.dir/qrc_smileys.cpp.o CMakeFiles/qtox.dir/src/main.cpp.o CMakeFiles/qtox.dir/qtox_automoc.cpp.o  -o qtox -rdynamic libqtox_static.a /usr/lib/x86_64-linux-gnu/libQt5Network.so.5.6.1 /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5.6.1 /usr/lib/x86_64-linux-gnu/libQt5Svg.so.5.6.1 /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.6.1 /usr/lib/x86_64-linux-gnu/libQt5Xml.so.5.6.1 -lavcodec -lavdevice -lavformat -lavutil -lexif -lqrencode -lsodium -lswscale -lsqlcipher -lvpx -lm -ltoxcore -ltoxdns -ltoxencryptsave -lm -lpthread -ltoxav -lopus -lvpx -lm -ltoxcore -ltoxdns -ltoxencryptsave -lm -lpthread -lopenal -lX11 -lXss -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lglib-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.6.1 /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.6.1 -ltoxav -lopus -lopenal -lX11 -lXss -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lfontconfig -lfreetype 
[  225s] /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib/libtoxcore.a(libtoxcore_la-crypto_core.o): undefined reference to symbol 'crypto_hash_sha256'
[  225s] //usr/lib/x86_64-linux-gnu/libsodium.so.18: error adding symbols: DSO missing from command line
[  225s] collect2: error: ld returned 1 exit status
[  225s] CMakeFiles/qtox.dir/build.make:3305: recipe for target 'qtox' failed

I can workaround this by adding the link libraries twice so that -lsodium comes after -ltoxcore, but it's a little hacky and would only fix the issue for qTox.

If I build toxcore with cmake instead of automake, it links correctly, and it was suggested on the qTox ticket that this might be a packaging issue with toxcore.

Since toxcore recommends building with automake, I'm wondering if there's a simple fix available.

@cringeops
Copy link

make install & ldconfig won’t do as far as I understand?

@SkyzohKey SkyzohKey added packaging Packaging P1 High priority labels Nov 19, 2017
@iphydf
Copy link
Member

iphydf commented Jan 16, 2018

@anthonybilinski does this still happen after #442?

@iphydf iphydf added this to the v0.2.x milestone Jul 16, 2018
@iphydf
Copy link
Member

iphydf commented Feb 4, 2022

Static linking works now.

@iphydf iphydf closed this as completed Feb 4, 2022
@iphydf iphydf modified the milestones: v0.2.x, v0.2.0 Feb 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority packaging Packaging
Projects
None yet
Development

No branches or pull requests

4 participants