LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 08-07-2009, 04:06 AM   #1
damien_d
LQ Newbie
 
Registered: Dec 2008
Posts: 17

Rep: Reputation: 0
boost_unit_test_framework{-mt , -gcc }


Hello all,

I've recently reinstalled Linux (ubuntu 9.04) due to a hard disk failure and and trying to reconfigure my programming environment.

Back on my old system, the following snippet from my CMake file happliy compiled:

Code:
# Testing for library
add_executable(Test_Maths_Array2D Maths/Test_Array2D.cpp)
target_link_libraries(Test_Maths_Array2D boost_unit_test_framework m)
add_test(Test_Maths_Array2D Test_Maths_Array2D)
But now, it spits out:
Code:
/usr/bin/ld: cannot find -lboost_unit_test_framework
collect2: ld returned 1 exit status
However, if I change it from:
Code:
boost_unit_test_framework       # <- Broken
boost_unit_test_framework-mt    # <- Working
What is the -mt suffix? There's also a lot of the -gcc suffix as well when I look in /usr/lib. For example:
Code:
lrwxrwxrwx 1 root root   51 2009-07-28 23:38 /usr/lib/libboost_unit_test_framework-gcc41-1_34_1.so.1.34.1 -> libboost_unit_test_framework-gcc42-1_34_1.so.1.34.1
lrwxrwxrwx 1 root root   54 2009-07-28 23:38 /usr/lib/libboost_unit_test_framework-gcc41-mt-1_34_1.so.1.34.1 -> libboost_unit_test_framework-gcc42-mt-1_34_1.so.1.34.1
-rw-r--r-- 1 root root 274K 2009-02-26 22:22 /usr/lib/libboost_unit_test_framework-gcc42-1_34_1.so.1.34.1
-rw-r--r-- 1 root root 274K 2009-02-26 22:22 /usr/lib/libboost_unit_test_framework-gcc42-mt-1_34_1.so.1.34.1
-rw-r--r-- 1 root root 1.1M 2009-03-27 12:28 /usr/lib/libboost_unit_test_framework-mt.a
lrwxrwxrwx 1 root root   41 2009-08-07 18:37 /usr/lib/libboost_unit_test_framework-mt.so -> libboost_unit_test_framework-mt.so.1.37.0
-rw-r--r-- 1 root root 325K 2009-02-27 09:10 /usr/lib/libboost_unit_test_framework-mt.so.1.35.0
-rw-r--r-- 1 root root 373K 2009-03-27 12:28 /usr/lib/libboost_unit_test_framework-mt.so.1.37.0
-rw-r--r-- 1 root root 325K 2009-02-27 09:10 /usr/lib/libboost_unit_test_framework.so.1.35.0
So once upon a time, there must have been a symlink of some sort, but I never put anything like that there.

It now works, but I wish I had an explanation as to why...

-- Damien
 
Old 08-07-2009, 08:51 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Squeeze (Fluxbox WM)
Posts: 1,331
Blog Entries: 44

Rep: Reputation: 334Reputation: 334Reputation: 334Reputation: 334
The '-mt' suffix indicates libraries that were built with multithreading support.

If you were using non '-mt' libraries on a multithreaded program, there would be problems (probably intermittent ones).

But you are doing the opposite, using '-mt' libraries on (presumably) a single threaded program, so this should be fine.

Incidentally, it looks like you have more than one version of the boost libraries. The single threaded version of the unit test library was an older version than the multi threaded version (and was missing the symlink). The single/multi threaded version depends on how the library was compiled (the distro repositories usually supply both).
 
Old 08-08-2009, 12:44 AM   #3
damien_d
LQ Newbie
 
Registered: Dec 2008
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by neonsignal View Post
The '-mt' suffix indicates libraries that were built with multithreading support.

If you were using non '-mt' libraries on a multithreaded program, there would be problems (probably intermittent ones).

But you are doing the opposite, using '-mt' libraries on (presumably) a single threaded program, so this should be fine.

Incidentally, it looks like you have more than one version of the boost libraries. The single threaded version of the unit test library was an older version than the multi threaded version (and was missing the symlink). The single/multi threaded version depends on how the library was compiled (the distro repositories usually supply both).
Thanks. I haven't done any multi-threading with Boost, so that explains that.

I was installing, then uninstalling, then installing again a bunch of different boost versions offered by my distro (Ubuntu 9.04) in an attempt to get it working.

-- Damien
 
  


Reply

Tags
boost, cmake, mt


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile error, 'H5G_obj_t' does not name a type, is gcc 4.3 incompatible with gcc 3 ? samrat_rao Linux - Software 5 03-03-2009 02:28 PM
yum install gcc doesn't set the lastest gcc ver 4.3.x kim,jw Linux - Newbie 3 12-22-2008 11:51 PM
Why gcc is needed for an HBA card? How to upgrade gcc enayet_v Linux - Newbie 3 11-17-2007 04:57 AM
gcc wont install, 'failed dependencies: glibc-devel is needed by gcc-3.3.3-41' TdlSnare Suse/Novell 3 11-29-2004 02:13 PM
export CC=/usr/bin/gcc-3.2 - switch gcc version? ferreter Linux - Software 1 08-20-2003 12:07 AM


All times are GMT -5. The time now is 11:20 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration