Using boost.build v2 to build/test application and boost

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using boost.build v2 to build/test application and boost

Felipe Magno de Almeida
Hi!

I'm having problems integrating boost.build v2 with my application and boost.
What I'm trying to do is to make boost.build in my application build
automatically what is needed in boost.

I have a test that is like this:

project mintercept/mail/test ;

import testing ;

test-suite mail
  : [ run test.cpp
$(MINTERCEPT_ROOT)/libs/boost/libs/test/build//boost_unit_test_framework
]
;

It compiles boost_unit_test_framework, and creates this tree from the
root of my application:
libs\boost\bin.v2\libs\test\build\msvc-7.1\debug\asynch-exceptions-on\link-static
The .lib created is: boost_unit_test_framework-vc71-d-1_34.lib
But the linker complains:

LINK : fatal error LNK1104: cannot open file 'libboost_unit_test_framework-vc71-
mt-gd-1_34.lib'

What do I do? Should I disable auto linking? If it is so, how do I do?
Or is the boost.build not building the correct target?

--
Felipe Magno de Almeida

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Using boost.build v2 to build/test application and boost

Vladimir Prus

> I'm having problems integrating boost.build v2 with my application and
> boost. What I'm trying to do is to make boost.build in my application build
> automatically what is needed in boost.
>
> I have a test that is like this:
>
> project mintercept/mail/test ;
>
> import testing ;
>
> test-suite mail
>
>   : [ run test.cpp
>
> $(MINTERCEPT_ROOT)/libs/boost/libs/test/build//boost_unit_test_framework
> ]
> ;
>
> It compiles boost_unit_test_framework, and creates this tree from the
> root of my application:
> libs\boost\bin.v2\libs\test\build\msvc-7.1\debug\asynch-exceptions-on\link-
>static The .lib created is: boost_unit_test_framework-vc71-d-1_34.lib
> But the linker complains:
>
> LINK : fatal error LNK1104: cannot open file
> 'libboost_unit_test_framework-vc71- mt-gd-1_34.lib'

Can you remove the "test.o" file produced from your "test.cpp" file (or touch
test.cpp), then run

    bjam --v2 -n

and post the output? I think the autolinking code thinks you're building
multi-thread application, while Boost.Build is building single-thread
application.

Can you build and run the following test application (without linking it to
anything)?:

    #include <boost/config.hpp>
    #include <stdio.h>
 
   int main()
   {
#if defined(_MT) || defined(__MT__)
       printf("MT build\n");
#else
       printf("ST build\n");
#endif  
   }

? That will help us to get right to the root of the problem.

> What do I do? Should I disable auto linking? If it is so, how do I do?

You can add <define>BOOST_ALL_NO_LIB=1 to the target's requirements, and it
might be good idea anyway, because Boost.Build will link to the library
itself, but it will be also desirable to debug the autolink problem -- just
in case in future you'd prefer to use autolink for some reason.

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build