I have a build system configured to build the project with boost (v1.53, Mac OS X Mountain Lion)
{
"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}'"]
}
]
}
However, when I try to test it with a simple program:
#include <iostream>
#include <boost/asio.hpp>
int main(){
std::cout << "Hello world! - boost" << std::endl;
return 0;
};
I get the following error (from sublime text 2 output):
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
With the console output being:
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
When I copy and paste that same command into terminal, it works without a problem. Is this just an issue with Sublime Text 2 not being able to use g++ correctly? Or is there some other issue.