Skeoch, Ronald Leaton
Ronald.Skeoch at unisys.com
Mon Aug 16 01:06:21 CEST 2010
I have been using the GMP library for about two weeks now... I have run into
a build problem that I have not been able to correct. I believe that I have
the library installed correctly but I am feeling that if it everything was
where it should be then I wouldn't be having a build problem, so I am
looking for some help.
I am using:
- Ubuntu 10.04 as O/S (VM guest)
- Geany 0.19 as my IDE
o (g++ --version) g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Geany has the following set in the build commands:
Compile: g++ -Wall -c "%f" -lgmp -lgmpxx
Build: g++ -Wall -o "%e" "%f" -lgmp -lgmpxx
My .cc file has the following globally defined:
#include "/home/user/gmp-5.0.1/gmpxx.h" //gmp library
using namespace std;
My functions are using statements like:
gmp_printf("Seed number is: %Zd\n", C_seed.get_mpz_t());
- This works without a problem
cout << "Seed number is: " << C_seed.get_mpz_t() << "\n";
- This causes a build problem, but the compile works fine.
gmp_printf("Prime number is: %Zd\n", Z_prime);
- Again this works fine
cout << "Prime number is: " << Z_prime << "\n";
- This causes the same issue as with the other cout statement above
g++ -Wall -o "blah2" "blah2.cc" -lgmp -lgmpxx (in directory: /home/user)
/usr/local/lib/libgmpxx.a(osdoprnti.o): In function
std::char_traits<char> >&, doprnt_params_t*, char*)':
osdoprnti.cc:(.text+0x8e): undefined reference to `__gmp_asprintf_final'
/usr/local/lib/libgmpxx.a(osfuns.o):(.rodata+0x4): undefined reference to
/usr/local/lib/libgmpxx.a(osfuns.o):(.rodata+0x8): undefined reference to
collect2: ld returned 1 exit status
Could someone point me in the right direction to resolve this build issue I
am having when I use cout?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 6317 bytes
Desc: not available
More information about the gmp-discuss