Boost logo

Boost :

From: Jeremy Pack (rostovpack_at_[hidden])
Date: 2008-07-03 20:15:00


Robert,

The load_single_library method is a convenience method for a common case. In
general, I recommend using a shared_library object instead. I believe this
case is detailed in the latest documentation.

However, you are probably right that I need to change the
load_single_library function to either return a bool or throw an exception.

Thanks for the heads up, and sorry about the time lost debugging.

Jeremy

On Thu, Jul 3, 2008 at 4:15 PM, Robert Dailey <rcdailey_at_[hidden]> wrote:

> When calling load_single_library(), if the 3rd parameter, which is the
> name of the export factory function, is incorrect,
> load_single_library() will silently fail and return as if nothing went
> wrong. However, since the name of that function was mistyped (in my
> case), I had to debug into the boost.extensions library to figure out
> the actual source of the problem. I think this should have thrown an
> exception.
>
> For example, I called the function like below:
>
> factory_map fm;
> load_single_library( fm, "my_library.dll", "my_export_method_typo" );
>
> And my function, as defined in the DLL source, is as follows:
>
> extern "C" void BOOST_EXTENSION_EXPORT_DECL
> my_export_method( boost::extensions::factory_map& fm )
> {
> }
>
> As you can see, the string (in the first code example) is clearly
> mistyped/misnamed. This results in silent failure. Opinions on this
> would be useful.
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk