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: Matthew Denno <>
  • To:
  • Subject: Re: [cgal-discuss] compiler error - undefined reference to `CGAL::assertion_fail(char const*, char const*, int, char const*)'
  • Date: Thu, 3 Dec 2009 19:21:38 -0500
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KSU7o+OJ9ryp5dbOJU2za1uRtvjgVhzX6ntMRcLDDEUxVN7wJNarrUG5OAX4DzqUWU eE3cPxEpLOOMEo0PgNq54knknTyKzYDkL4vqBqFaYr1eOe0/VaPZnZXBX/TaqEOfXw8o rr8ixK2KIBEp9TrVdNFzbSMFE8k4ERgV9xstw=

I think that you need to add LIBS += -lCGAL to your .pro file.  Also you should add -frounding-math flag, but I forget exactly how...I am on my mobile right now so I can't look.

On Dec 3, 2009 6:53 PM, "Ramin H" <> wrote:

Hi everyone,

I am using CGAL3.5 and Ubuntu 9.10. Most of the examples and demos
compile successfully but when I try to compile the following code:

---- begin: main.cpp ----
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
int main() {
  return 0;
}
---- end main.cpp ----

I get the following errors on the terminal (the Makefile is generated
from a Qt .pro project file.):
------------------
ramin@ubundev:~/NetBeansProjects/test-cgal$ qmake nef.pro
ramin@ubundev:~/NetBeansProjects/test-cgal$ make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_XML_LIB
-DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
-I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore
-I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL
-I/usr/include/qt4/QtXml -I/usr/include/qt4 -I/usr/include
-I../../CGAL-3.5/include -I/usr/X11R6/include -I. -o main.o main.cpp
g++ -Wl,-O1 -o nef main.o    -L/usr/lib -L/usr/X11R6/lib -L/usr/lib
-L/home/ramin/CGAL-3.5/lib -lQtXml -lQtOpenGL -lQtGui -lQtCore -lGLU
-lGL -lpthread
main.o: In function `global constructors keyed to main':
main.cpp:(.text+0x246): undefined reference to
`CGAL::assertion_fail(char const*, char const*, int, char const*)'
main.cpp:(.text+0x270): undefined reference to
`CGAL::assertion_fail(char const*, char const*, int, char const*)'
main.cpp:(.text+0x29a): undefined reference to
`CGAL::assertion_fail(char const*, char const*, int, char const*)'
main.cpp:(.text+0x2c4): undefined reference to
`CGAL::assertion_fail(char const*, char const*, int, char const*)'
collect2: ld returned 1 exit status
make: *** [nef] Error 1
------------------

Any idea what's wrong? Do I need a specific compiler switch to compile
CGAL programs in this environment?

Thank you,
-Ramin

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss




Archive powered by MHonArc 2.6.16.

Top of Page