Jeroen Demeyer on Wed, 21 Feb 2007 17:30:04 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

libpari and static linking


Hello list,

I wrote a C++ program which uses libPARI for factoring integers (the function Z_factor()). However, it only compiles with dynamic linking. When I link -static, I get the following errors:

factor.o: In function `factornumber(number_t const&)':
factor.cpp:(.text+0x10c): undefined reference to `avma'
factor.cpp:(.text+0x16c): undefined reference to `bot'
factor.cpp:(.text+0x195): undefined reference to `avma'
factor.cpp:(.text+0x1d9): undefined reference to `Z_factor'
factor.cpp:(.text+0x280): undefined reference to `avma'
factor.cpp:(.text+0x29c): undefined reference to `pari_init'
factor.cpp:(.text+0x2ba): undefined reference to `pari_err'
factor.cpp:(.text+0x2cb): undefined reference to `pari_err'
collect2: ld returned 1 exit status

This was compiled with g++ (GCC) 3.4.6

Maybe a certain trick is needed to make static linking work? It could be a C vs. C++ problem, but with dynamic linking, it works perfectly.

Cheers,
Jeroen