C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to link boost library?

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
Sven Bauhan
Guest





PostPosted: Sun Aug 15, 2004 10:51 am    Post subject: How to link boost library? Reply with quote



Hi group,

for testing of my own classes I want to use the boost test facilities.
So I tried to compile the example
(http://www.boost.org/libs/test/doc/examples/test_exec_monitor_example.html)
at my computer:

bash-2.05b$ g++ -c test_exec_example.cpp
bash-2.05b$ g++ -o test_exec -lboost_unit_test_framework-gcc
test_exec_example.o
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/../../../libboost_unit_test_framework-gcc.so:
undefined reference to `init_unit_test_suite(int, char**)'
collect2: ld returned 1 exit status

I do not know if this is the correct library to link to the test code.

Can anyone tell me, how to link this example or how to get information on
this?

Thanks,
Sven


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Maxim Yegorushkin
Guest





PostPosted: Sun Aug 15, 2004 2:26 pm    Post subject: Re: How to link boost library? Reply with quote



Sven Bauhan <svenbauhan (AT) web (DOT) de> wrote:

Quote:
for testing of my own classes I want to use the boost test facilities.
So I tried to compile the example

[]

Quote:
I do not know if this is the correct library to link to the test code.

Just #include "boost/test/included/unit_test_framework.hpp". The header
includes framework's sources in your project so that you don't have to link to a library..

--
Maxim Yegorushkin

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Sven Bauhan
Guest





PostPosted: Tue Aug 17, 2004 10:04 pm    Post subject: Re: How to link boost library? Reply with quote



Maxim Yegorushkin wrote:
Quote:

Just #include "boost/test/included/unit_test_framework.hpp". The header
includes framework's sources in your project so that you don't have to
link to a library..


But this does not work at all. I only get a lot of compiler errors:

bash-2.05b$ g++ -c test_exec_example.cpp
In Datei, eingefügt von test_exec_example.cpp:8:
/usr/include/boost/test/included/unit_test_framework.hpp:18:47:
libs/test/src/execution_monitor.cpp: Datei oder Verzeichnis nicht gefunden
/usr/include/boost/test/included/unit_test_framework.hpp:20:40:
libs/test/src/test_tools.cpp: Datei oder Verzeichnis nicht gefunden
/usr/include/boost/test/included/unit_test_framework.hpp:22:46:
libs/test/src/unit_test_result.cpp: Datei oder Verzeichnis nicht gefunden
/usr/include/boost/test/included/unit_test_framework.hpp:23:45:
libs/test/src/unit_test_suite.cpp: Datei oder Verzeichnis nicht gefunden
/usr/include/boost/test/included/unit_test_framework.hpp:24:50:
libs/test/src/unit_test_parameters.cpp: Datei oder Verzeichnis nicht
gefunden
/usr/include/boost/test/included/unit_test_framework.hpp:25:43:
libs/test/src/unit_test_log.cpp: Datei oder Verzeichnis nicht gefunden
/usr/include/boost/test/included/unit_test_framework.hpp:26:47:
libs/test/src/unit_test_monitor.cpp: Datei oder Verzeichnis nicht gefunden
/usr/include/boost/test/included/unit_test_framework.hpp:27:53:
libs/test/src/supplied_log_formatters.cpp: Datei oder Verzeichnis nicht
gefunden
/usr/include/boost/test/included/unit_test_framework.hpp:29:44:
libs/test/src/unit_test_main.cpp: Datei oder Verzeichnis nicht gefunden

Greetz, Sven


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Maxim Yegorushkin
Guest





PostPosted: Wed Aug 18, 2004 12:16 pm    Post subject: Re: How to link boost library? Reply with quote

Sven Bauhan <svenbauhan (AT) web (DOT) de> wrote:

Quote:
Just #include "boost/test/included/unit_test_framework.hpp". The header
includes framework's sources in your project so that you don't have to
link to a library..


But this does not work at all. I only get a lot of compiler errors:

bash-2.05b$ g++ -c test_exec_example.cpp

[]

I can't read german, but it looks like you did not specify boost library root as include path, did you?

Try this:

g++ -I $(pwd)/../../../. test_exec_example.cpp

BTW, test_exec_example.cpp won't link when compiled alone, since it's a part of regression test.

--
Maxim Yegorushkin

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.