Question about compiling and running C-programs with PPL

Hello,
I'm trying to work with an older version (0.2) now (just to practice). I installed everything and "make check" confirmed that everything was OK.
I took the inters1.cc file and replaced all include files with "ppl.hh". I also removed the print_constraints commands and namespace std. I tried to compile the code, but I get a huge amount of error messages saying 'undefined reference to...'. The compilation was started with
gcc inters1.cc -L/opt/ppl-0.2/lib -I/opt/ppl-0.2/include -lgmp
I think I do something stupid (as a beginner in using libraries), but I can't figure out what. Could you tell me how to use this library correctly in my code?
Thank you!
Martin Rohde
Delft University of Technology Kramers Laboratorium voor Fysische Technologie Tel 0031 +152787084 Mail martin@klftfs01.tn.tudelft.nl

Martin Rohde wrote:
Hello,
I'm trying to work with an older version (0.2) now (just to practice). I installed everything and "make check" confirmed that everything was OK.
I took the inters1.cc file and replaced all include files with "ppl.hh". I also removed the print_constraints commands and namespace std. I tried to compile the code, but I get a huge amount of error messages saying 'undefined reference to...'. The compilation was started with
gcc inters1.cc -L/opt/ppl-0.2/lib -I/opt/ppl-0.2/include -lgmp
I think I do something stupid (as a beginner in using libraries), but I can't figure out what. Could you tell me how to use this library correctly in my code?
Dear Martin,
at a first glance, your command line lacks -lppl -lgmpxx. In fact, with -L/opt/ppl-0.2/lib you are only adding an element to the library search path, but you should also specify, with -lppl, that you request linking with the PPL library. For the same reason, you should also use -lgmpxx to link with the C++ interface of GMP. As a final note, using the g++ command instead of gcc is safer (even though for the command you quoted I believe it does not matter). All the best
Roberto
participants (2)
-
Martin Rohde
-
Roberto Bagnara