Re:Re: [boost] [program_options] cw9.3 failures

Howard Hinnant wrote:
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?
I believe that most of the failures of the serialization library with toolset are due to similar problems. There we have Template<class T> Struct A : public Abase { A(const char * name){ //register this instance in a global table Register(this, name); } // static instance to be created at pre-runtime Static A instance; do_something(); }; Template<class T> Static A A::instance("T"); So that later when // lookup T Abase *ab = std::find("T") Ab->do_something(); It seems that the compiler optimizes away the code since its never explicitly called. An attempt to find the class through its name fails, the code isn't found, and the test fails. I've attempted to force instantiation of the code through various means such as dllexport and others. This solved the problem for other compilers but I've been unable to get it to work for Metrowerks. Alas my, 15 trial license expired so it will have to remain as it is until someone with an interest in this compiler decides they want to spend some time on this. Robert Ramey
participants (1)
-
Robert Ramey