[bjam] warn: Unable to construct <library target name>

Hi Everyone, I've recently tried the suggestion in the Boost.Build documentation regarding the use of the lib rule to name libraries that can be supplied as dependencies and having the library available in the search path. I have a Jamfile that looks like: project my_project : requirements <include>.. <link>static ; lib some_system_installed_lib : : <name>mylib ; exe my_exe : my_main.cpp some_system_installed_lib ; I then get the 'warn: Unable to construct <library target name>' message when running bjam. Am I doing something wrong? I'm referring to this page: http://boost.org/boost-build2/doc/html/bbv2/tasks/libraries.html and I'm using the bjam updated to today. Have a good day everyone. -- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://cplusplus-soup.blogspot.com/] [mikhailberis@gmail.com] [+63 928 7291459] [+1 408 4049523]

Hi there Dean, On 26/11/2007, Dean Michael Berris <mikhailberis@gmail.com> wrote:
Hi Everyone,
I've recently tried the suggestion in the Boost.Build documentation regarding the use of the lib rule to name libraries that can be supplied as dependencies and having the library available in the search path. I have a Jamfile that looks like:
project my_project : requirements <include>.. <link>static ;
lib some_system_installed_lib : : <name>mylib ;
I'm not sure what you expect this to do. This lib has no sources and IIUC no actual target. You can use the <location>/path/to/your/lib 'bit' (not sure if this is called a feature, property, or what). I think that's what you're expecting the <name> property? to do. Just as a tip; something I noticed the other day from looking at the sandbox math toolkit. If you want to link to a Boost.Build target, such as a boost library (eg. Boost.Thread), you can use: use-project /boost/thread/ : $(boost-root)/libs/thread/build ; exe my_exe : my_main.cpp : <library>/boost/thread/ ; And AFAICT this will mean my_exe uses the right Boost.Thread object file for the exe's requirements, building it if necessary. It'll also inherit all the requirements of that project. I thought this was very cool. I get the impression that this isn't common knowledge. :( Hope that helps, Darren

Hi Darren! On Nov 26, 2007 3:33 AM, Darren Garvey <darren.garvey@gmail.com> wrote:
On 26/11/2007, Dean Michael Berris <mikhailberis@gmail.com> wrote:
Hi Everyone,
I've recently tried the suggestion in the Boost.Build documentation regarding the use of the lib rule to name libraries that can be supplied as dependencies and having the library available in the search path. I have a Jamfile that looks like:
project my_project : requirements <include>.. <link>static ;
lib some_system_installed_lib : : <name>mylib ;
I'm not sure what you expect this to do. This lib has no sources and IIUC no actual target. You can use the <location>/path/to/your/lib 'bit' (not sure if this is called a feature, property, or what). I think that's what you're expecting the <name> property? to do.
Actually, I've gotten around it by doing the following (taking an example for example to use system installed MySQL client libraries): lib mysqlclient : : <link>static:<file>/usr/local/mysql/lib/libmysqlclient.a <link>shared:<name>mysqlcient ; lib z : : # Required by mysqlclient <link>static:<file>/usr/lib/libz.a <link>shared:<name>z ; alias mysql : mysqlclient z ;
Just as a tip; something I noticed the other day from looking at the sandbox math toolkit. If you want to link to a Boost.Build target, such as a boost library (eg. Boost.Thread), you can use:
use-project /boost/thread/ : $(boost-root)/libs/thread/build ;
exe my_exe : my_main.cpp : <library>/boost/thread/ ;
And AFAICT this will mean my_exe uses the right Boost.Thread object file for the exe's requirements, building it if necessary. It'll also inherit all the requirements of that project. I thought this was very cool. I get the impression that this isn't common knowledge. :(
Well, it should be common knowledge. I've been putting the following code to pull in the Boost root dir into the top level Jamfile (or Jamroot) of some of my projects: import modules ; # Look for BOOST_ROOT environment variable local BOOST_ROOT : [ modules.peek : BOOST_ROOT ] ; use-project /boost : $(BOOST_ROOT) ; exe my_exe : main.cpp /boost//thread /boost//regex ;
Hope that helps,
Definitely does. :) Thanks for taking the time to share the tip! -- Dean Michael C. Berris Software Engineer, Friendster, Inc. [http://cplusplus-soup.blogspot.com/] [mikhailberis@gmail.com] [+63 928 7291459] [+1 408 4049523]
participants (2)
-
Darren Garvey
-
Dean Michael Berris