Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Link Issues With g++

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Link Issues With g++


Chronological Thread 
  • From: Marc Glisse <>
  • To:
  • Subject: Re: [cgal-discuss] Link Issues With g++
  • Date: Fri, 13 May 2011 17:28:28 +0200 (CEST)

On Fri, 13 May 2011, Gaurav Kanade wrote:

I am a new user of CGAL and have some problems with issues involving
linking libraries.

This is not really a CGAL question but a general question about linking.

I use the command

g++ -lCGAL -lCGAL_Core Scenario.cpp
/usr/bin/ld: /tmp/ccydV8IU.o: undefined reference to symbol 'mpfr_set_q'
/usr/bin/ld: note: 'mpfr_set_q' is defined in DSO
/usr/lib64/libmpfr.so.1 so try adding it to the linker command line
/usr/lib64/libmpfr.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status

Now based upon the suggestion it gave me I tried to link the file
libmpfr.so.1 and then it gives

g++ -lCGAL -lCGAL_Core -llibmpfr.so.1 Scenario.cpp
/usr/bin/ld: cannot find -llibmpfr.so.1
collect2: ld returned 1 exit status

I know that the file exists in /usr/lib64 as I can see it there ...
any idea how to resolve this ?

Look at -lCGAL. Do you have a file CGAL in /usr/lib64? What you actually have is a file called libCGAL.so (or libCGAL.a). As explained in the man pages of gcc and ld, -lsmurf corresponds to the file libsmurf.so. So you actually want -lmpfr (and probably -lgmp afterwards).

--
Marc Glisse



Archive powered by MHonArc 2.6.16.

Top of Page