0
votes

I was using LLVM GCC 4.2 compiler but for a reason I want to use Apple LLVM compiler instead. I use some boost libraries statically linked.

My code part is here:

#include <boost/program_options/detail/config_file.hpp>

std::set<std::string> options;
std::map<std::string, std::string> parameters;
options.insert("*");

for (config_file_iterator i(config, options), e ; i != e; ++i) 
    parameters[i->string_key] = i->value[0];

When I changed the compiler in Xcode 4.5.1 to Apple LLVM 4.1, it gives me this error:



    In file included from A.cpp:16:
    boost_1_46_1/boost/program_options/detail/config_file.hpp:163:17: error: 
    call to function 'to_internal' that is neither visible in the template 
    definition nor found by argument-dependent lookup
        s = to_internal(in);
            ^
    A.cpp:82:39: note: in instantiation of member function
    'boost::program_options::detail::basic_config_file_iterator::getline' 
    requested here
        for (config_file_iterator i(config, options), e ; i != e; ++i) 
                                  ^
    boost_1_46_1/boost/program_options/detail/convert.hpp:70:48: note: 
    'to_internal' should be declared prior to the call site or 
    in namespace '__gnu_cxx'
BOOST_PROGRAM_OPTIONS_DECL std::string to_internal(const std::string&);

enter image description here

Does somebody know what is the solution?

1
I don't think there is such a thing as an " LLVM GCC 4.2 " compiler...LtWorf
@LtWorf I have added a screenshot that you can see the compiler options.Volkan Ozyilmaz
Mh that must be apple's way to call "DragonEgg" i suppose...LtWorf

1 Answers

1
votes

Please find, at the top of detail/config_file.hpp, the following line:

#include <boost/program_options/detail/convert.hpp>

And remove #if and #endif around that line. Everything should be building fine after that. The fix is already included in current versions.