Good question. Since I don't have that compiler, I've been unable to reproduce it.

Is this: error: error C2039: 'boost::get': Ist kein Element von 'boost::extensions::shared_library'.

The only error that you see?

Please add the command line option /P to your build - this will output the preprocessed version of your file test_extension_and_optional.cpp. Then send this to me - I might be able to figure out what is going on. It looks like one of the preprocessor macros used by Boost.PreProcessor isn't working - I do have some ideas about what may cause the problem.

See: http://support.microsoft.com/kb/134650

What happens when you move boost/optional.hpp after the extension headers?

Jeremy

On Fri, Apr 18, 2008 at 8:01 AM, David Matz <david.matz@spatialview.com> wrote:
Hi,

it seems that the problem concerns a specific compiler bug in microsoft compilers <= 13.10.6030 (MSVC 7.1).

The MSVC8 and g++ (4.1.2) compilers are able to build the code without errors.


#include <boost/optional/optional.hpp>    // included for some reason
#include <boost/extension/shared_library.hpp>
#include <boost/extension/convenience.hpp>    // load_single_library

void loadExtension () {
   boost::extensions::factory_map fm;
   // we don't need the following line to produce the compiler error
   //boost::extensions::load_single_library(fm, ".", "external_function_name");
}

Any ideas how to get it to work with the good old Visual Studio 2003?


--
David Matz
----------------------------
Software Developer
Spatial View GmbH