linking problem

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

linking problem

Seungtaik Oh
Hi, all

I am trying to build my application on mac os. Compiling is okay, but in linking I have the following error:

ld: library not found for -lcrt0.o
collect2: ld returned 1 exit status


The command for linking is

g++-4 -o a.out -O2 -m64 -static ***.o -L/usr/local/cgal/lib -L/usr/local/boost_1_34_1/boost/lib -lCGAL -lCGALimageIO -lCGALPDB -lboost_program_options -lm .

What is wrong?

Seungtaik
Reply | Threaded
Open this post in threaded view
|

Re: linking problem

Laurent Rineau (GeometryFactory)
On Thursday 08 January 2009 03:43:06 Seungtaik Oh wrote:

> Hi, all
>
> I am trying to build my application on mac os. Compiling is okay, but in
> linking I have the following error:
>
> ld: library not found for -lcrt0.o
> collect2: ld returned 1 exit status
>
>
> The command for linking is
>
> g++-4 -o a.out -O2 -m64 -static ***.o -L/usr/local/cgal/lib
> -L/usr/local/boost_1_34_1/boost/lib -lCGAL -lCGALimageIO -lCGALPDB
> -lboost_program_options -lm .


Can you add "-v" to your command line and post here the first lines of the
output (that should be a list of libraries, search paths, and so on), and the
full error log?

Then /maybe/ one can help you afterward.

--
Laurent Rineau, PhD
Engineer at GeometryFactory
http://www.geometryfactory.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
Reply | Threaded
Open this post in threaded view
|

Re: linking problem

Sylvain Pion
Administrator
In reply to this post by Seungtaik Oh
Seungtaik Oh wrote:

> Hi, all
>
> I am trying to build my application on mac os. Compiling is okay, but in
> linking I have the following error:
>
> ld: library not found for -lcrt0.o
> collect2: ld returned 1 exit status
>
>
> The command for linking is
>
> g++-4 -o a.out -O2 -m64 -static ***.o -L/usr/local/cgal/lib
> -L/usr/local/boost_1_34_1/boost/lib -lCGAL -lCGALimageIO -lCGALPDB
> -lboost_program_options -lm .
>
> What is wrong?
If you play with -m64, you'd better know what you are doing...
(and be prepared to find out what's wrong, including with all
third party libs which need to be compiled in 64bits)
I'm not sure the problem is specifically linked to CGAL.

--
Sylvain Pion
INRIA Sophia-Antipolis
Geometrica Project-Team
CGAL, http://cgal.org/

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: linking problem

Seungtaik Oh
In reply to this post by Laurent Rineau (GeometryFactory)
This is a message at compile process:
=============
g++-4 -c delaunay_example.cpp -O2 -m64 -static -v -frounding-math -I/usr/local/cgal/include/ -I/usr/local/boost_1_34_1/
Using built-in specs.
Target: i686-apple-darwin9
Configured with: ../gcc-4.2.2/configure --prefix=/sw --prefix=/sw/lib/gcc4.2 --mandir=/sw/share/man --infodir=/sw/share/info --enable-languages=c,c++,fortran,objc,java --with-arch=nocona --with-tune=generic --host=i686-apple-darwin9 --with-gmp=/sw --with-libiconv-prefix=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib
Thread model: posix
gcc version 4.2.2
 /sw/lib/gcc4.2/libexec/gcc/i686-apple-darwin9/4.2.2/cc1plus -quiet -v -I/usr/local/cgal/include/ -I/usr/local/boost_1_34_1/ -imultilib x86_64 -D__STATIC__ delaunay_example.cpp -quiet -dumpbase delaunay_example.cpp -m64 -mtune=generic -march=nocona -auxbase delaunay_example -O2 -version -frounding-math -o /var/folders/Gu/GuP+-kvoFUuFr+ynxVyqVE+++TI/-Tmp-//ccXqHzch.s
ignoring nonexistent directory "/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin9/4.2.2/../../../../i686-apple-darwin9/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/cgal/include/
 /usr/local/boost_1_34_1/
 /sw/lib/gcc4.2/lib/gcc/i686-apple-darwin9/4.2.2/../../../../include/c++/4.2.2
 /sw/lib/gcc4.2/lib/gcc/i686-apple-darwin9/4.2.2/../../../../include/c++/4.2.2/i686-apple-darwin9/x86_64
 /sw/lib/gcc4.2/lib/gcc/i686-apple-darwin9/4.2.2/../../../../include/c++/4.2.2/backward
 /usr/local/include
 /sw/lib/gcc4.2/include
 /sw/lib/gcc4.2/lib/gcc/i686-apple-darwin9/4.2.2/include
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks
End of search list.
============

And this is a message at linking:
===================
g++-4 -o delaunay_example -O2 -m64 -static -v delaunay_example.o  -L/usr/local/cgal/lib -lCGAL -lCGALimageIO -lCGALPDB -lm
Using built-in specs.
Target: i686-apple-darwin9
Configured with: ../gcc-4.2.2/configure --prefix=/sw --prefix=/sw/lib/gcc4.2 --mandir=/sw/share/man --infodir=/sw/share/info --enable-languages=c,c++,fortran,objc,java --with-arch=nocona --with-tune=generic --host=i686-apple-darwin9 --with-gmp=/sw --with-libiconv-prefix=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib
Thread model: posix
gcc version 4.2.2
 /sw/lib/gcc4.2/libexec/gcc/i686-apple-darwin9/4.2.2/collect2 -static -arch x86_64 -weak_reference_mismatches non-weak -o delaunay_example -lcrt0.o -L/usr/local/cgal/lib -L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin9/4.2.2/x86_64 -L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin9/4.2.2/../../../x86_64 -L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin9/4.2.2 -L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin9/4.2.2/../../.. delaunay_example.o  -lCGAL -lCGALimageIO -lCGALPDB -lm -lstdc++ -lgcc_eh -lgcc
ld: library not found for -lcrt0.o
collect2: ld returned 1 exit status
make: *** [delaunay_example] Error 1
==============


On Thu, Jan 8, 2009 at 7:01 PM, Laurent Rineau (GeometryFactory) <[hidden email]> wrote:
On Thursday 08 January 2009 03:43:06 Seungtaik Oh wrote:
> Hi, all
>
> I am trying to build my application on mac os. Compiling is okay, but in
> linking I have the following error:
>
> ld: library not found for -lcrt0.o
> collect2: ld returned 1 exit status
>
>
> The command for linking is
>
> g++-4 -o a.out -O2 -m64 -static ***.o -L/usr/local/cgal/lib
> -L/usr/local/boost_1_34_1/boost/lib -lCGAL -lCGALimageIO -lCGALPDB
> -lboost_program_options -lm .


Can you add "-v" to your command line and post here the first lines of the
output (that should be a list of libraries, search paths, and so on), and the
full error log?

Then /maybe/ one can help you afterward.

--
Laurent Rineau, PhD
Engineer at GeometryFactory
http://www.geometryfactory.com/

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

Reply | Threaded
Open this post in threaded view
|

Re: linking problem

Laurent Rineau (GeometryFactory)
On Friday 09 January 2009 06:05:26 Seungtaik Oh wrote:

> And this is a message at linking:
> ===================
> g++-4 -o delaunay_example -O2 -m64 -static -v delaunay_example.o
>  -L/usr/local/cgal/lib -lCGAL -lCGALimageIO -lCGALPDB -lm
> Using built-in specs.
> Target: i686-apple-darwin9
> Configured with: ../gcc-4.2.2/configure --prefix=/sw
> --prefix=/sw/lib/gcc4.2 --mandir=/sw/share/man --infodir=/sw/share/info
> --enable-languages=c,c++,fortran,objc,java --with-arch=nocona
> --with-tune=generic --host=i686-apple-darwin9 --with-gmp=/sw
> --with-libiconv-prefix=/sw --with-system-zlib
> --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib
> Thread model: posix
> gcc version 4.2.2
>  /sw/lib/gcc4.2/libexec/gcc/i686-apple-darwin9/4.2.2/collect2 -static -arch
> x86_64 -weak_reference_mismatches non-weak -o delaunay_example -lcrt0.o
> -L/usr/local/cgal/lib
> -L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin9/4.2.2/x86_64
> -L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin9/4.2.2/../../../x86_64
> -L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin9/4.2.2
> -L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin9/4.2.2/../../..
> delaunay_example.o  -lCGAL -lCGALimageIO -lCGALPDB -lm -lstdc++ -lgcc_eh
> -lgcc
> ld: library not found for -lcrt0.o
> collect2: ld returned 1 exit status
> make: *** [delaunay_example] Error 1

It seems your compiler is broken. That command line option "-lcrt0.o" is
completly false.

Have a look at `gcc -dumpspecs`, where you should find the broken specs. Try
to upgrade to gcc-4.3, which is newer.

--
Laurent Rineau, PhD
Engineer at GeometryFactory
http://www.geometryfactory.com/

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