Boost logo

Boost :

From: jerome.wacongne_at_[hidden]
Date: 2008-01-03 12:11:29


Hi,

My problem might be a beginner one, but I spent all day searching forums
and mailing archives and it didn't help much, so I am asking at the
source.
The reason why I write this email is that modifying boost source helps but
what I did is not enough.

what I did :
- a first test file using helper macros to test a class (works fine alone)
:
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_SUITE(Class1TestsSuite);
BOOST_AUTO_TEST_CASE( test1 ){
        BOOST_CHECK(1 == 2-1);
}
BOOST_AUTO_TEST_SUITE_END();

- add a second test file using helper macros to test an other class
(compilation is OK, link KO) :
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_SUITE(Class2TestsSuite);
BOOST_AUTO_TEST_CASE( test2 ){
        BOOST_CHECK(1 != 2);
}
BOOST_AUTO_TEST_SUITE_END();

Here are the errors :
c:/dev/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.1-dw2/../../../../include/c++/4.2.1-dw2/new
multiple definition of `init_unit_test_suite(int, char**)' line
105
tests\main.o:c:/dev/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.1-dw2/../../../../include/boost/test/unit_test_suite.hpp
first defined here line 184

I have edited unit_test_suite.hpp to add inline decalration to
init_unit_test_suite :
#else
inline ::boost::unit_test::test_suite*
init_unit_test_suite( int, char* [] ) {
#endif

Doing so, first error is suppressed. I might need to rebuild boost test
lib for the second, but I haven't the tools at workplace.

I am using :
- Windows XP
- MinGW packaged with boost 1.34.1 (http://nuwen.net/mingw.html)
- Eclipse CDT

Regards,
Jérôme.

This message and any attachments (the "message") is
intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message.
Overlay AM (and its subsidiaries) shall (will) not
therefore be liable for the message if modified.

                ---------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le
"message") sont etablis a l'intention exclusive de ses
destinataires et sont confidentiels. Si vous recevez ce
message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur. Toute utilisation de ce
message non conforme a sa destination, toute diffusion
ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse. L'internet ne permettant pas
d'assurer l'integrite de ce message, Overlay AM (et ses
filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk