崇高文本2问题我已经配置建立与提升项目(V1.53的Mac OS X山狮)与升压
{
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}", "-I/usr/local/include -L/usr/local/lib -lboost_system"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"cmd": ["bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
}
]
}
但是构建系统,当我尝试用一个简单的测试一下程序:
#include <iostream>
#include <boost/asio.hpp>
int main(){
std::cout << "Hello world! - boost" << std::endl;
return 0;
};
我得到以下错误(从崇高文本2输出):
Undefined symbols for architecture x86_64:
"boost::system::system_category()", referenced from:
__static_initialization_and_destruction_0(int, int)in cct7f9yj.o
boost::asio::error::get_system_category() in cct7f9yj.o
"boost::system::generic_category()", referenced from:
__static_initialization_and_destruction_0(int, int)in cct7f9yj.o
ld: symbol(s) not found for architecture x86_64
collect2: [Finished in 1.1s with exit code 1]ld returned 1 exit status
与控制台输出中:
Running g++ /Users/xxxx/Desktop/event_system/main.cpp -o /Users/xxxx/Desktop/event_system/main -I/usr/local/include -L/usr/local/lib -lboost_system
当我将相同的命令复制并粘贴到终端中时,它可以正常工作。这只是Sublime Text 2无法正确使用g ++的问题吗?或者还有其他一些问题。
请问您可以尝试将此参数分成三个:“-I/usr/local/include -L/usr/local/lib -lboost_system”? – longhua 2013-03-16 09:10:55
修复它,谢谢! – Mike 2013-03-17 10:59:03
林间空地帮助你。 – longhua 2013-03-17 11:50:01