C++11 Build system for Sublime text

Revision en1, by Z38, 2016-09-16 21:31:10

Hi all,

Recently I had a talk with koosaga and he told me that unfortunately he can't use #include <bits/stdc++.h> because his operating system is OS X. I was surprised to know that because I'm using this header on OS X without any troubles.
When I explained him how I manage to do that he told me I should compose a topic about this because it will help many people :)
So I will try to cover two things in my post:
a) How to compile #include <bits/stdc++.h> in Sublime text? (easy one)
b) How to compile C++11 features like lambdas, auto, etc. in Sublime text? (a bit harder)
Let's get started.

#include<bits/stdc++.h> usage
3 easy steps.
1) Install Xcode
2) Download stdc++.h from my GitHub. The file is not mine of course, I just googled it and commented out including cstdalign library because it just wouldn't compile on my mac (I wasn't interested enough to figure out why).
3) Now you must simply put stdc++.h into /Applications/Xcode.app/Contents/Developer/Platforms/ChosenTargetPlatform/Developer/SDKs/ChosenMacOSSDK/usr/include/bits
Done!

C++11 features usage
Here you will need a custom build system for Sublime text. It's easy to create!
3 easy steps again.
1) Download gpp.sublime-build from my GitHub.
2) Go to Sublime, then select Tools->Build System->New Build System. This is the place where you should paste gpp.sublime-build. Don't forget to save the file.
3) Relaunch Sublime, from now on your new build system will be available at Tools->Build System.
Done!

I hope someone will find this helpful. Thanks for your attention! :)

Tags sublime text, c++11

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Z38 2016-09-16 21:35:01 26
en1 English Z38 2016-09-16 21:31:10 1894 Initial revision (published)