Boost logo

Boost-Build :

Subject: [Boost-build] Jamfile setup for load on demand DLLS
From: Robert Ramey (ramey_at_[hidden])
Date: 2009-12-21 13:03:55


Here is a small piece of code which is part of one of my serialization
tests:

HINSTANCE hDLL; // Handle to DLL
hDLL = LoadLibrary("dll_polymorphic_derived2.dll");
BOOST_CHECK_MESSAGE((0 != hDLL), "Failed to find/load
dll_polymorphic_derived2" );
save_exported(testfile);
load_exported(testfile);
FreeLibrary(hDLL);

This runs successfully when I test from the msvc ide where the file
"dll_polymorphic_derived2.dll"
has been placed in the same directory as the executable. So far so good.

When I update my Jamfile.v2 with

lib dll_polymorphic_derived2_lib
:
polymorphic_derived2.cpp
../build//boost_serialization
:
<link>shared
;

...

[ test-bsl-run test_dll_plugin : : dll_polymorphic_derived2_lib :
<runtime-link>shared ]

It's not clear to me where the dll is located. That is, should the
following be changed?

hDLL = LoadLibrary("dll_polymorphic_derived2.dll");

and if so to what?.

Also, I make a new version of the above code for *nix which uses dlopen,
dlclose, etc.
But again, I'm not sure what the path names should be.

Any help appreciated.

Robert Ramey


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