【发布时间】:2015-08-07 15:26:17
【问题描述】:
我对使用 GNU 非常陌生。我正在尝试开始使用 boost 文件系统库,但我不断收到这些错误。我正在尝试使用boost::filesystem 获取当前工作目录。
我的代码:
boost::filesystem::path full_path( boost::filesystem::detail::current_path() );
cout << "Current path is : " << full_path << endl;
我的命令:
g++ -I boost_1_58_0 main.cpp -o example
结果:
Undefined symbols for architecture x86_64:
"boost::filesystem::detail::current_path(boost::system::error_code*)", referenced from:
_main in main-1c56eb.o
"boost::system::system_category()", referenced from:
___cxx_global_var_init2 in main-1c56eb.o
"boost::system::generic_category()", referenced from:
___cxx_global_var_init in main-1c56eb.o
___cxx_global_var_init1 in main-1c56eb.o
ld: symbol(s) not found for architecture x86_64
有人可以解释错误的要求吗?我做错了什么?
【问题讨论】: