title: Telling if C++ code is portable
body: <p>I'm trying to write code that can be compiled with any modern version of g++ and am having difficulties. I wrote the code using Visual Studios and it worked fine but I tried compiling it on another computer and it had problems.</p>
  
  <p>One problem was it didn't recognize the macro <code>EXIT_SUCCESS</code>. I see <a href="http://en.cppreference.com/w/cpp/utility/program/EXIT_status" rel="nofollow noreferrer">here</a> it's defined in <code>cstdlib</code> but how come in VS I didn't need to import that library?</p>
  
  <p>Also in a .h file I had <code>const private int PI = 3.1416</code> and on the other computer it didn't like that.</p>
  
  <p>So how do you know what's going to be portable? I thought C (and therefore inherently C++) was invented to be compiled anywhere. I asked <a href="https://stackoverflow.com/questions/21370024/can-visual-stuidos-be-used-to-develop-in-c-and-still-create-a-program-capable">this</a> question but think it go misinterpreted, are there certain settings that must be done to the IDE to ensure portability? </p>
  
  <p>EDIT: I might understand it better knowing why did the code compile in Visual Studio without <code>include &lt;cstdlib&gt;</code> and how do you turn off such feature?</p>