Error Linking A Simple Application using Boost.Any
Hello all,
I'm really new to boost and I tried compiling and then linking the
following program :
#include <iostream>
#include
g++ -IC:\Boost\include\boost-1_32 -pedantic -s -O3 -fno-exceptions -c boost_trial.cpp -o boost_trial.o
But when I try to link the file using: g++ -IC:\Boost\include\boost-1_32 boost_trial.cpp -o boost_trial.exe I get the following errors: /mingw/lib/libstdc++.a(eh_personality.o)(.data$_ZTISt9exception[typeinfo for std::exception]+0x0): multiple definition of `typeinfo for std::exception' C:\DOCUME~1\dpilla\LOCALS~1\Temp/ccoBaaaa.o(.rdata$_ZTISt9exception[typeinfo for std::exception]+0x0):boost_trial.cpp: first defined here /mingw/lib/libstdc++.a(eh_personality.o)(.text$_ZTSSt9exception[typeinfo name for std::exception]+0x0): multiple definition of `typeinfo name for std::exception' C:\DOCUME~1\dpilla\LOCALS~1\Temp/ccoBaaaa.o(.rdata$_ZTSSt9exception[typeinfo name for std::exception]+0x0):boost_trial.cpp: first defined here /mingw/lib/libstdc++.a(functexcept.o)(.data$_ZTISt8bad_cast[typeinfo for std::bad_cast]+0x0): multiple definition of `typeinfo for std::bad_cast' C:\DOCUME~1\dpilla\LOCALS~1\Temp/ccoBaaaa.o(.rdata$_ZTISt8bad_cast[typeinfo for std::bad_cast]+0x0):boost_trial.cpp: first defined here /mingw/lib/libstdc++.a(functexcept.o)(.text$_ZTSSt8bad_cast[typeinfo name for std::bad_cast]+0x0): multiple definition of `typeinfo name for std::bad_cast' C:\DOCUME~1\dpilla\LOCALS~1\Temp/ccoBaaaa.o(.rdata$_ZTSSt8bad_cast[typeinfo name for std::bad_cast]+0x0):boost_trial.cpp: first defined here collect2: ld returned 1 exit status I have no idea why this is happening! What am I doing wrong? Somebody please tell me the right way to link the file. Thanks a million. Regards, Dinesh Pillay. -- - Perfection or Nothing.
On 6/7/05, Dinesh Pillay
g++ -IC:\Boost\include\boost-1_32 -pedantic -s -O3 -fno-exceptions -c boost_trial.cpp -o boost_trial.o
But when I try to link the file using: g++ -IC:\Boost\include\boost-1_32 boost_trial.cpp -o boost_trial.exe
I get the following errors:
/mingw/lib/libstdc++.a(eh_personality.o)(.data$_ZTISt9exception[typeinfo for std::exception]+0x0): multiple definition of `typeinfo for std::exception' C:\DOCUME~1\dpilla\LOCALS~1\Temp/ccoBaaaa.o(.rdata$_ZTISt9exception[typeinfo for std::exception]+0x0):boost_trial.cpp: first defined here /mingw/lib/libstdc++.a(eh_personality.o)(.text$_ZTSSt9exception[typeinfo name for std::exception]+0x0): multiple definition of `typeinfo name for std::exception' C:\DOCUME~1\dpilla\LOCALS~1\Temp/ccoBaaaa.o(.rdata$_ZTSSt9exception[typeinfo name for std::exception]+0x0):boost_trial.cpp: first defined here /mingw/lib/libstdc++.a(functexcept.o)(.data$_ZTISt8bad_cast[typeinfo for std::bad_cast]+0x0): multiple definition of `typeinfo for std::bad_cast' C:\DOCUME~1\dpilla\LOCALS~1\Temp/ccoBaaaa.o(.rdata$_ZTISt8bad_cast[typeinfo for std::bad_cast]+0x0):boost_trial.cpp: first defined here /mingw/lib/libstdc++.a(functexcept.o)(.text$_ZTSSt8bad_cast[typeinfo name for std::bad_cast]+0x0): multiple definition of `typeinfo name for std::bad_cast' C:\DOCUME~1\dpilla\LOCALS~1\Temp/ccoBaaaa.o(.rdata$_ZTSSt8bad_cast[typeinfo name for std::bad_cast]+0x0):boost_trial.cpp: first defined here collect2: ld returned 1 exit status
I have no idea why this is happening! What am I doing wrong? Somebody please tell me the right way to link the file.
I suspect the problem is you have disabled exceptions (-fno-exceptions). Are you doing this for any particular reason? Also, why are you stripping your object files (-s in the compile line)? Hopefully gcc is ignoring this, but this may also be the cause of your grief. g++ -Ic:/boost/include/boost-1_32 -O3 -c boost_trial.cpp g++ -s -o boost_trial.exe boost_trial.o -- Caleb Epstein caleb dot epstein at gmail dot com
participants (2)
-
Caleb Epstein
-
Dinesh Pillay