gmpxx and Creator problem
-
I'm on Linux, trying to use gmpxx and Qt, I have no problems using gmpxx outside of Qt.
in pro file I add :LIBS += -lgmpxx
Code is very simple :
#include <gmpxx.h> mpz_class a, b;
Errors :
:-1: error: mainwindow.o: undefined reference to symbol '__gmp_get_memory_functions' /usr/lib64/libgmp.so.10:-1: error: error adding symbols: DSO missing from command line :-1: error: collect2: error: ld returned 1 exit status
I'm lost, can anyone help with this ?
-
Hi
It cant find the gmpxx lib/so filehttps://stackoverflow.com/questions/24096807/dso-missing-from-command-line
You need to tell what folder
http://doc.qt.io/qt-5/third-party-libraries.html -
It can find it, in the error you can see the path to the libgmp
Anyway, even when path specified error stays the same.
I've use 3rd party libs before and had no problems, this one is for some reason special.Just solved it, trick is to add -lgmp as well, weird but ok :)
-
@mrjj
there are two so files, libgmp.so and libgmpxx.so
gmpxx is C++, otherwise gmp is used.It was my mistake, been awhile since I've used gmp, I actually had to include both libs when I was linking outside of QT, so it has nothing to do with QT, for some reason I thought that gmpxx is just enough and I completely forgot about adding gmp as well.