mavak / trucov

True coverage tool for C / C++
1 stars 1 forks source link

Failed to link on cygwin, mingw, and mingw-cross compiler. (boost 1.40) #176

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. cmake
2. make

What is the expected output? What do you see instead?

expected: executable created.

(worked fine on linux machine for linux targets)

instead: linking failed. (see below)

What version of the product are you using? On what operating system?
trucov 10.1
trucov 10.2 beta

Windows XP, SP3

a) Cygwin GCC 4.5.3 (recent), with Boost 1.40 (Boost 1.48 previously installed)
b) MinGW GCC 4.5.2, with Boost 1.40
c) Linux Cross Compiler i586-mingw32msvc

Please provide any additional information below.

Linking fails at the stage
Scanning dependencies of target trucov
[100%] Building CXX object CMakeFiles/trucov.dir/src/main.cpp.o
Linking CXX executable trucov.exe
CMakeFiles/trucov.dir/src/main.cpp.o:main.cpp:(.text+0xd4): undefined reference 
to `boost::system::get_system_category()'
CMakeFiles/trucov.dir/src/main.cpp.o:main.cpp:(.text+0xde): undefined reference 
to `boost::system::get_generic_category()'
CMakeFiles/trucov.dir/src/main.cpp.o:main.cpp:(.text+0xe8): undefined reference 
to `boost::system::get_generic_category()'
CMakeFiles/trucov.dir/src/main.cpp.o:main.cpp:(.text+0xf2): undefined reference 
to `boost::system::get_generic_category()'
CMakeFiles/trucov.dir/src/main.cpp.o:main.cpp:(.text+0xfc): undefined reference 
to `boost::system::get_system_category()'

/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: 
CMakeFiles/trucov.dir/src/main.cpp.o: bad reloc address 0x8 in section 
`.text$_ZN5boost16exception_detail10clone_baseD1Ev[boost::e
ception_detail::clone_base::~clone_base()]'

Sorry, I have no idea what may be the reason for this.
Passing additional CFLAGS and LDFLAGS to force the inclusion of
the library did not do the trick.

The result if I use the i586-mingw32msv compiler looks a little
bit different, but similar.

Please give me a hint what I might be doing wrong.

Original issue reported on code.google.com by slok.mob...@googlemail.com on 5 Jul 2012 at 2:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
--- Please ignore the post ---

Sorry :-( 
I did not see, that I simply had to add "boost_system" to the CMakeLists.txt 
file..

Original comment by slok.mob...@googlemail.com on 6 Jul 2012 at 9:37