{"id":151,"date":"2015-04-07T06:12:01","date_gmt":"2015-04-07T06:12:01","guid":{"rendered":"http:\/\/toolbox.pingvinfeszek.hu\/?p=151"},"modified":"2015-05-31T09:07:49","modified_gmt":"2015-05-31T09:07:49","slug":"sublime-text-ccpp-build-system-under-macosx-yosemite","status":"publish","type":"post","link":"https:\/\/wp.gaborhargitai.hu\/sublime-text-ccpp-build-system-under-macosx-yosemite\/","title":{"rendered":"Sublime Text C++\/CPP Build System under MacOSX Yosemite"},"content":{"rendered":"

Using the ever-so-wonderful Sublime Text as your primary editor is a joy in itself, however, building your .cpp files under OS X with it was something I wasn’t able to do out-of-the-box. Here are the steps that would enable you start compiling in no time – and as always, you need to have Xcode installed<\/strong> with its’ command line tools<\/strong> in order for any of this to work properly.<\/p>\n

 <\/p>\n

    \n
  1. Go to this site:\u00a0https:\/\/packagecontrol.io\/installation<\/a>\u00a0and follow the installation instructions<\/li>\n
  2. After you’re done, open Package Control in Sublime by pressing ctrl + shift + p<\/strong><\/li>\n
  3. Search and install the following: ” C++ Starting Kit<\/strong> “<\/li>\n
  4. Create a the following file:
    \n\/Users\/yourusername\/Library\/Application Support\/Sublime Text 3\/Packages\/User\/C++.sublime-buildPaste this into the newly created C++.sublime-build<\/strong> file:<\/li>\n<\/ol>\n

    {
    \n\"cmd\": [\"g++\", \"${file}\", \"-o\", \"${file_path}\/${file_base_name}\"],
    \n\"file_regex\": \"^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$\",
    \n\"working_dir\": \"${file_path}\",
    \n\"selector\": \"source.c, source.c++\",
    \n\"variants\":
    \n[
    \n{
    \n\"name\": \"Run\",
    \n\"cmd\": [\"bash\", \"-c\", \"g++ '${file}' -o '${file_path}\/${file_base_name}' && '${file_path}\/${file_base_name}'\"]
    \n}
    \n]
    \n}
    \n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"

    Using the ever-so-wonderful Sublime Text as your primary editor is a joy in itself, however, building your .cpp files under OS X with it was something I wasn’t able to do out-of-the-box. Here are the steps that would enable you start compiling in no time – and as always, you need to have Xcode installed […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[],"_links":{"self":[{"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/posts\/151"}],"collection":[{"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":3,"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"predecessor-version":[{"id":162,"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/posts\/151\/revisions\/162"}],"wp:attachment":[{"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.gaborhargitai.hu\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}