Boost logo

Boost-Build :

From: Dirk Griffioen (dirk.griffioen_at_[hidden])
Date: 2005-07-19 14:28:24


Hi John,

Thanks for the reply and sorry for my late one

John Maddock wrote:

>>Maybe this is helpful?
>>
>>boost/test/unit_test.hpp has the following lines:
>>
>>#if 0
>>#ifndef BOOST_TEST_NO_AUTO_LINK
>>
>>#define BOOST_LIB_NAME unix_test_framework
>>#define BOOST_LIB_DIAGNOSTIC yes
>>#include <boost/config/auto_link.hpp>
>>
>>#endif
>>#endif
>>
>>(which has been there as long as I can remember - and causes problems
>>when you download boost and link to boost_unit_test_framework.lib with
>>vc71 for the first time :)
>>
>>
>
>What? How so? Note the "#if 0" this is all disabled for the test lib
>(because the test lib can't tell which of it's many lib builds to link
>against based upon which header you've included).
>
>
>
but how come the lib name has the auto-link extension - vc71-mt-gd-1_32

this should not happen, or should it?

as far as I can tell, the #if 0 should prevent the name being decorated

>>if I change that to:
>>
>>#if 1
>>#if !defined(BOOST_ALL_NO_LIB)
>>#include <boost/config/auto_link.hpp>
>>#endif
>>#endif
>>
>>the link errror disappears.
>>
>>
>
>How so, now you *have* turned on auto-linking.
>
>
I did? But I did

<define>BOOST_ALL_NO_LIB=1

in my toplevel jamfile and if it's not defined, but it is, it should do
auto_link

so it does not auto_link and it all seems to work .

>
>
>>However, the next thing that happens is:
>>
>>boost_prg_exec_monitor.lib(cpp_main.obj) : error LNK2019: unresolved
>>external symbol "int __cdecl cpp_main(int,char * * const)"
>>(?cpp_main@@YAHHQAPAD_at_Z) referenced in function "public: virtual int
>>__thiscall `anonymous namespace'::cpp_main_caller::function(void)"
>>
>>which I find curious, since I never had to link against that library
>>where I used to link to 'boost_unit_test_framework.lib' only. (And
>>still, gcc is not complaining).
>>
>>Why do I need a cpp_main when I turn of auto_link?
>>
>>I would be very happy if this is easily explained - and thus fixed :)
>>
>>
>
>You need a cpp_main if you use the prg_exec_monitor lib, a test_main if you
>link to the test lib, and a unit_test_main if you link to the unit test lib.
>Clear, or just more confused? :-)
>
>
>
that was my own fault, the jamfile now contains:

<library>/boost/test//boost_unit_test_framework

so the

prg_exec_monitor lib is

is no longer scanned (?) and no unresolved cpp_main left to be resolved

Still a bit conf. :)

Cheers, Dirk

>John.
>
>
>
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>

 --------------020100080701090609080900 Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi John,<br>
<br>
Thanks for the reply and sorry for my late one<br>
<br>
John Maddock wrote:
<blockquote cite="mid015501c58ab3$481b60a0$4b4f0e52_at_fuji" type="cite">
<blockquote type="cite">
<pre wrap="">Maybe this is helpful?

boost/test/unit_test.hpp has the following lines:

#if 0
#ifndef BOOST_TEST_NO_AUTO_LINK

#define BOOST_LIB_NAME unix_test_framework
#define BOOST_LIB_DIAGNOSTIC yes
#include &lt;boost/config/auto_link.hpp&gt;

#endif
#endif

(which has been there as long as I can remember - and causes problems
when you download boost and link to boost_unit_test_framework.lib with
vc71 for the first time :)
</pre>
</blockquote>
<pre wrap=""><!---->
What? How so? Note the "#if 0" this is all disabled for the test lib
(because the test lib can't tell which of it's many lib builds to link
against based upon which header you've included).

</pre>
</blockquote>
but how come the lib name has the auto-link extension - vc71-mt-gd-1_32<br>
<br>
this should not happen, or should it? <br>
<br>
as far as I can tell, the #if 0 should prevent the name being decorated<br>
<blockquote cite="mid015501c58ab3$481b60a0$4b4f0e52_at_fuji" type="cite">
<pre wrap=""></pre>
<blockquote type="cite">
<pre wrap="">if I change that to:

#if 1
#if !defined(BOOST_ALL_NO_LIB)
#include &lt;boost/config/auto_link.hpp&gt;
#endif
#endif

the link errror disappears.
</pre>
</blockquote>
<pre wrap=""><!---->
How so, now you *have* turned on auto-linking.
</pre>
</blockquote>
I did? But I did <br>
<br>
&lt;define&gt;BOOST_ALL_NO_LIB=1 <br>
<br>
in my toplevel jamfile and if it's not defined, but it is, it should do
auto_link<br>
<br>
so it does not auto_link and it all seems to work .<br>
<br>
<blockquote cite="mid015501c58ab3$481b60a0$4b4f0e52_at_fuji" type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">However, the next thing that happens is:

boost_prg_exec_monitor.lib(cpp_main.obj) : error LNK2019: unresolved
external symbol "int __cdecl cpp_main(int,char * * const)"
(?cpp_main@@YAHHQAPAD_at_Z) referenced in function "public: virtual int
__thiscall `anonymous namespace'::cpp_main_caller::function(void)"

which I find curious, since I never had to link against that library
where I used to link to 'boost_unit_test_framework.lib' only. (And
still, gcc is not complaining).

Why do I need a cpp_main when I turn of auto_link?

I would be very happy if this is easily explained - and thus fixed :)
</pre>
</blockquote>
<pre wrap=""><!---->
You need a cpp_main if you use the prg_exec_monitor lib, a test_main if you
link to the test lib, and a unit_test_main if you link to the unit test lib.
Clear, or just more confused? :-)

</pre>
</blockquote>
that was my own fault, the jamfile now contains:<br>
<br>
&lt;library&gt;/boost/test//boost_unit_test_framework<br>
<br>
so the <br>
<pre wrap="">prg_exec_monitor lib is</pre>
is no longer scanned (?) and no unresolved cpp_main left to be resolved<br>
<br>
Still a bit conf.  :)<br>
<br>
Cheers, Dirk<br>
<blockquote cite="mid015501c58ab3$481b60a0$4b4f0e52_at_fuji" type="cite">
<pre wrap="">John.

Yahoo! Groups Links

&lt;*&gt; To visit your group on the web, go to:
<a class="moz-txt-link-freetext" href="http://groups.yahoo.com/group/jamboost/">http://groups.yahoo.com/group/jamboost/>

&lt;*&gt; To unsubscribe from this group, send an email to:
<a class="moz-txt-link-abbreviated" href="mailto:jamboost-unsubscribe_at_[hidden]">jamboost-unsubscribe_at_[hidden]</a>

&lt;*&gt; Your use of Yahoo! Groups is subject to:
<a class="moz-txt-link-freetext" href="
http://docs.yahoo.com/info/terms/">http://docs.yahoo.com/info/terms/>

</pre>
</blockquote>
<br>
</body>
</html>
 --------------020100080701090609080900--


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk