Hi Guys How do I include boost dependencies in my makefile ? /usr/local/boost_1_39_0/boost/stage/lib/libboost_program_options-gcc43-mt-1_39.a /usr/local/boost_1_39_0/boost/stage/lib/libboost_thread-gcc43-mt-1_39.a -lpthread
Shaolin wrote:
Hi Guys
How do I include boost dependencies in my makefile ?
/usr/local/boost_1_39_0/boost/stage/lib/libboost_program_options-gcc43-mt-1_39.a /usr/local/boost_1_39_0/boost/stage/lib/libboost_thread-gcc43-mt-1_39.a -lpthread
You add those to the linker invocation command in your makefile. Alternatively, you can use: -L/usr/local/boost_1_39_0/boost/stage/lib/ -lboost_program_options-gcc43-mt-1_39 -lboost_thread-gcc43-mt-1_39 -lpthread Note that this question has nothing to do with C++ Boost. I recommend that you read manuals on make and gcc to get more detailed answer. - Volodya
On Tue, Aug 25, 2009 at 11:58 AM, Vladimir
Prus
Shaolin wrote:
How do I include boost dependencies in my makefile ?
/usr/local/boost_1_39_0/boost/stage/lib/libboost_program_options-gcc43-mt-1_39.a /usr/local/boost_1_39_0/boost/stage/lib/libboost_thread-gcc43-mt-1_39.a -lpthread
You add those to the linker invocation command in your makefile. Alternatively, you can use:
-L/usr/local/boost_1_39_0/boost/stage/lib/ -lboost_program_options-gcc43-mt-1_39 -lboost_thread-gcc43-mt-1_39 -lpthread
Note that this question has nothing to do with C++ Boost. I recommend that you read manuals on make and gcc to get more detailed answer.
I think the question he was asking wasn't how to use make, but the boost sorta-specific problem of linking the correct boost library depending on whether we are building release, debug, multi-threaded, and so on. Since the spelling changes, it can be painful to manage by hand. We built a make-based build system that supports some of boost name generation, such as BOOST_LIBS += thread it would generate the proper link line, with the properly decorated library name based on whether or not we're building in release or debug, multi-thread or single, etc. I think that a "standard" boost makefile library that can be included by other makefiles to make it easier to include and link boost libs would be very useful. Chris
Hi all,
2009/8/25 Chris Uzdavinis
On Tue, Aug 25, 2009 at 11:58 AM, Vladimir Prus
wrote: Shaolin wrote:
How do I include boost dependencies in my makefile ?
/usr/local/boost_1_39_0/boost/stage/lib/libboost_program_options-gcc43-mt-1_39.a
/usr/local/boost_1_39_0/boost/stage/lib/libboost_thread-gcc43-mt-1_39.a -lpthread
You add those to the linker invocation command in your makefile. Alternatively, you can use:
-L/usr/local/boost_1_39_0/boost/stage/lib/ -lboost_program_options-gcc43-mt-1_39 -lboost_thread-gcc43-mt-1_39 -lpthread
Note that this question has nothing to do with C++ Boost. I recommend that you read manuals on make and gcc to get more detailed answer.
I think the question he was asking wasn't how to use make, but the boost sorta-specific problem of linking the correct boost library depending on whether we are building release, debug, multi-threaded, and so on. Since the spelling changes, it can be painful to manage by hand.
We built a make-based build system that supports some of boost name generation, such as
BOOST_LIBS += thread
it would generate the proper link line, with the properly decorated library name based on whether or not we're building in release or debug, multi-thread or single, etc.
I think that a "standard" boost makefile library that can be included by other makefiles to make it easier to include and link boost libs would be very useful.
CMake is of great help for that! Regards, Olivier
Chris _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Aug 26, 2009, at 9:14 AM, Alfredo Correa wrote:
2009/8/25 Chris Uzdavinis
CMake is of great help for that! thank you, can you give a one or two line example on how use cmake to choose the right boost library file?
See http://www.cmake.org/cmake/help/cmake2.6docs.html#module:FindBoost
Hi,
2009/8/26 Alfredo Correa
2009/8/25 Chris Uzdavinis
CMake is of great help for that! thank you, can you give a one or two line example on how use cmake to choose the right boost library file?
Here is an example: project( MyProject ) set( Boost_ADDITIONAL_VERSIONS "1.38.0" "1.39.0" ) set( Boost_USE_STATIC_LIBS OFF ) set( Boost_USE_MULTITHREAD ON ) find_package( Boost 1.36.0 REQUIRED ) if( Boost_FOUND ) include_directories( ${Boost_INCLUDE_DIR} ) link_directories( ${Boost_LIBRARY_DIR} ) else() message( FATAL_ERROR "Boost not found ! Please set Boost directories !" ) endif() add_executable( projectbinary myproject.cpp ) target_link_libraries( projectbinary ${Boost_LIBRARIES} ) Have a look at cmake documentation for more details ( http://www.cmake.org/cmake/help/cmake2.6docs.html and in particular http://www.cmake.org/cmake/help/cmake2.6docs.html#module:FindBoost). Regards, Olivier
Alfredo _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi, Here is an example:
project( MyProject )
set( Boost_ADDITIONAL_VERSIONS "1.38.0" "1.39.0" ) set( Boost_USE_STATIC_LIBS OFF ) set( Boost_USE_MULTITHREAD ON ) find_package( Boost 1.36.0 REQUIRED ) if( Boost_FOUND ) include_directories( ${Boost_INCLUDE_DIR} ) link_directories( ${Boost_LIBRARY_DIR} ) else() message( FATAL_ERROR "Boost not found ! Please set Boost directories !" ) endif()
add_executable( projectbinary myproject.cpp ) target_link_libraries( projectbinary ${Boost_LIBRARIES} )
I made a mistake. Please use this line: find_package( Boost 1.36.0 REQUIRED thread system unit_test_framework ) You can be more specific on the libs you want to use. Regards, Olivier
participants (6)
-
Alfredo Correa
-
Chris Uzdavinis
-
James C. Sutherland
-
Olivier Tournaire
-
Shaolin
-
Vladimir Prus