I guess this problem is less related to GMP than to general C++ compilation, but it would be very helpful if someone could nevertheless explain me what to do.<br><br>When compiling the following simple program<br><br>#include <
gmp.h><br>#include <gmpxx.h><br>#include <iostream><br><br>using namespace std;<br><br>int main() {<br> mpf_class f;<br> f = 3.5 * 2.2;<br> cout << f;<br> return 0;<br>}<br><br>with the following command
<br><br>g++ max-npv.cc -static -lgmp -lgmpxx<br><br>I get the following error message:<br><br>/usr/local/lib/libgmpxx.a(osmpf.o): In function `operator<<(std::basic_ostream<char, std::char_traits<char> >&, __mpf_struct const*)':
<br>osmpf.cc:(.text+0x131): undefined reference to `__gmp_doprnt_mpf2'<br>osmpf.cc:(.text+0x139): undefined reference to `__gmp_asprintf_final'<br>/usr/local/lib/libgmpxx.a(osfuns.o):(.rodata+0x4): undefined reference to `__gmp_asprintf_memory'
<br>/usr/local/lib/libgmpxx.a(osfuns.o):(.rodata+0x8): undefined reference to `__gmp_asprintf_reps'<br>collect2: ld returned 1 exit status<br><br>If I remove the line "cout << f" from the code, everything works fine. I have used the "--enable-cxx" parameter during the make process, so that should be okay.
<br><br>Can anybody give me a hint what I need to do?<br><br>Best,<br><br>Wolfram<br>