2012-11-22 49 views
0

我使用LLVM GCC 4.2编译器,但出于一个原因,我想使用苹果LLVM编译器。我使用静态链接的一些boost库。升压失败与苹果llvm program_options编译

我的部分代码是在这里:

#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]; 

当我改变了编译器在Xcode 4.5.1苹果LLVM 4.1,它给了我这个错误:

 


    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

有人知道什么是解决方案吗?

+0

我不认为有这样的事情,“LLVM GCC 4.2”编译器... – LtWorf

+0

@LtWorf我添加了一个截图,你可以看到编译器选项。 –

+0

Mh必须是苹果的方式叫“DragonEgg”我想...... – LtWorf

回答

1

请找,在detail/config_file.hpp顶部,下面一行:

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

,并删除#if#endif围绕该线。在此之后,一切都应该建立良好。该修补程序已包含在当前版本中。

+0

非常感谢你:)我真的不明白,如果文件已被编译器看到或没有。 –