Bill Allombert on Tue, 14 Jan 2003 15:24:52 +0100


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

Re: how to include the u_FpM_inv() declaration (2)


On Tue, Jan 14, 2003 at 12:27:47PM +0100, Ramón Casero Cañas wrote:
> I've tried also to just copy the funcion declaration, but it is not compiled
> into the library, or so it seems
> 
> g++ -o bin/gamatrix -Wall   -ftemplate-depth-50 m_gamatrix.cpp
> lib/gamatrix.o -lpari-2.2 -lboost_thread
> -lstlport /usr/src/eo-0.9.2/src/utils/libeoutils.a
> /usr/src/eo-0.9.2/src/libeo.a /usr/src/eo-0.9.2/src/ga/libga.a /usr/src/eo-0.9.2/src/es/libes.a 
> /usr/lib/libgmp.a -lm
> lib/gamatrix.o(.text+0x2f8): In function `inverse_mat_mod2(bool **, unsigned
> int, bool)':
> : referencia a `u_FpM_inv(long *, unsigned long)' sin definir
> collect2: ld returned 1 exit status
> make: *** [bin/gamatrix] Error 1

You use C++, so you must add the declaration in a extern "C" { } scope.

You should avoid using C++ with PARI 2.2.4, you may have trouble.  In
particular PARI 2.2.4 does not compile with g++.  The 2.1 serie and the
forthcoming 2.2.5 should be OK thought.

Cheers,
Bill.