[PPL-devel] PPlibrary

Roberto Bagnara bagnara at cs.unipr.it
Sat Jul 3 11:21:27 CEST 2004


Enrico Oliosi wrote:
> Today I downloaded the version 0.5 of PPL, and I downloaded GPM version 
> 4.1.3.
> I installed the GMP version 4.1.3 with enable-cxx option, then
> I installed the PPL version 0.5 with GMP option (I specified where GMP
> include and lib dirs were).
> I tried to compile a simple program like this:
> 
> #include "ppl.hh"
> using namespace std;
> using namespace Parma_Polyhedra_Library;
> 
> int main() {
>   return 0;
> }
> 
> with this comand and options:
> 
> bash> g++ -g constraints1.cc -I ../ppl05/include/ -L ../ppl05/lib/libppl.a
> 
> to check if it compiles correctly, but the result is:
> 
> /tmp/ccyWC2l1.o(.text+0x36): In function 
> `__static_initialization_and_destruction_0(int, int)':
> : undefined reference to `Parma_Polyhedra_Library::Init::Init[in-charge]()'
> /tmp/ccyWC2l1.o(.text+0x65): In function `__tcf_11':
> : undefined reference to `Parma_Polyhedra_Library::Init::~Init 
> [in-charge]()'
> /tmp/ccyWC2l1.o(.gnu.linkonce.r._ZTVN23Parma_Polyhedra_Library6GenSysE+0x10): 
> undefined reference to 
> `Parma_Polyhedra_Library::GenSys::ascii_dump(std::basic_ostream<char, 
> std::char_traits<char> >&) const'
> 
> [...]
> 
> it doesn't find the PPL library.

Dear Enrico,

your invoking g++ the wrong way.  First, the -L option wants the path
to a directory (where to look for library files), not the complete path
leading to a specific *.a file.
Secondly, you must link with the PPL, the C++ interface of GMP, and
with GMP itself, and you need 3 -l switches to specify that.
Summing it up, your compilation command should be something like

   g++ -g constraints1.cc -I ../ppl05/include/ -L ../ppl05/lib/ -lppl -lgmpxx -lgmp

assuming that you have installed both GMP and PPL in ../ppl05.
If GMP has been installed elsewhere, you will have to add the corresponding
-I and -L switches.
Please, let us know if this solves your problem.
All the best,

     Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it



More information about the PPL-devel mailing list