|
Boost-Build : |
From: mronion13 (cam_at_[hidden])
Date: 2004-02-26 17:38:34
Hey,
I am trying to come up with a simple way to link an extension DLL to
my main program using Boost.Build v1, with the intention that my
program will load this DLL when it is needed using LoadLibrary
(equivalent to dlopen in linux). This is easily accomplished in linux
by passing the -E flag to the linker which exports all symbols from
the main program so the run-time linker can resolve the undefined
symbols in the shared object. However, in windows, to compile the
plugin DLL, you must link against the import library from the main
program that is generated when the main program is compiled. My main
program also has a library it links from (a core library with some
core functions). I first tried what I considered to be the most
natural way to express this in bjam:
project-root ;
dll main_core
: main_core.cpp
;
exe main_prog
: main_prog.cpp
<dll>main_core
;
dll plugin_1
: <dll>main_core
<exe>main_prog
plugin_1.cpp
;
stage bin/stage-dir
: <dll>main_core <dll>plugin_1 <exe>main_prog
;
But bjam complains:
Unknown suffix on <@mainproj>main_prog.exe - see UserObject rule in
Jamfile(5)
Then I modified the <exe> in front of main_prog to <lib> (thinking
this might bring in the import library). But bjam complains:
unknown dependent target libmain_prog.lib
Redefining PRELIB for NT to "" gives the error:
unknown dependent target main_prog.lib
Then I thought I would just hack the thing:
dll plugin_1
: <dll>main_core
plugin_1.cpp
: <debug><library-path>bin/main_proj/main_prog.exe/vc7/debug
<release><library-path>bin/main_proj/main_prog.exe/vc7/release
<find-library>main_prog
;
However, the proper dependencies are not generated, so it may be
necessary to run bjam more than once to get all targets to pass (but
they do compile and run successfully!)
Now, is there a better way to do this?
Thanks for any help,
-Andy
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