Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] compiler error - undefined reference to `CGAL::assertion_fail(char const*, char const*, int, char const*)'

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] compiler error - undefined reference to `CGAL::assertion_fail(char const*, char const*, int, char const*)'


Chronological Thread 
  • From: "Laurent Rineau (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] compiler error - undefined reference to `CGAL::assertion_fail(char const*, char const*, int, char const*)'
  • Date: Fri, 4 Dec 2009 15:34:58 +0100
  • Organization: GeometryFactory

On Friday 04 December 2009 15:21:42 Ramin H wrote:
> Thank you very much. I added LIBS += -lCGAL -lCGAL_Core to the end of
> .pro file and that solved the problem.
>
> I thought LIBS += -L"/home/ramin/CGAL-3.5/lib" would be enough and
> linker will find what it needs in that folder. Does LIBS += -lCGAL
> -lCGAL_Core tell linker to use specific libraries in that folder?

-lCGAL tells the linker to find out a file named libCGAL.so and link with it.
The -L flags that are given *before* modify the list of directories to search
in. In your case, you added /usr/lib before -L$HOME/CGAL-3.5/lib/. If you had
a file /usr/lib/libCGAL.so (for example from a package libcgal3-dev of
Ubuntu), that one would be used instead of the one from the CGAL-3.5 you have
installed in your home directory.

> Also, it compiled without the -frounding-math flag.

Well, it does compile without -frounding-math, but, if you compile with
compiler optimization (which is very recommended with CGAL), your compiler
may
use optimization about floating point arithmetic that create bugs in CGAL
numeric algorithms.

You should put the following in your pro file, near its beginning:

QMAKE_CXXFLAGS += -frounding-math

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/



Archive powered by MHonArc 2.6.16.

Top of Page