Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2004-09-24 10:39:08


On Sep 24, 2004, at 8:11 AM, Vladimir Prus wrote:

>
> The current regression test results show two similar failures of
> program_options on cw9.3
>
> http://tinyurl.com/6ay5m
>
> The situation is the following:
>
> parsers.hpp contain:
>
> template<class charT>
> basic_parsed_options<charT>
> parse_config_file(std::basic_istream<charT>&, const
> options_description&);
>
> parsers.cpp contain:
>
> template<class charT>
> basic_parsed_options<charT>
> parse_config_file(std::basic_istream<charT>& is,
> const options_description& desc)
> {
> ........
> }
>
> template
> BOOST_PROGRAM_OPTIONS_DECL basic_parsed_options<char>
> parse_config_file(std::basic_istream<char>& is,
> const options_description& desc);
>
> And the linker can't find the explicitly instantinated function. This
> happens
> only in _dll tests, so I'd suspect a bug in the compiler/linker.
>
> Can anybody sched the light on this?

How are clients (who can view only parsers.hpp) to know that:

template<>
     basic_parsed_options<char>
     parse_config_file(std::basic_istream<char>& is,
                       const options_description& desc);

is a function to be imported from a DLL? Does adding to parsers.hpp
something like:

template<> __declspec(dllimport)
     basic_parsed_options<char>
     parse_config_file(std::basic_istream<char>& is,
                       const options_description& desc);

help?

-Howard


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