We are going to start a new project in our small team:
Unfortunately, our developers have never written a single code on any platform other than Windows! So I have to give them a “code like this or ”, not a code like this list , so the code will remain cross-platform.
any guidance?
GCC . , , , , ++ . , GNU make, , .
- , , :
#include <windows.h> #include <unistd.h> #include <sys/almost_anything.h>
.
, , . , . , -.
( , , , ), , . , 32- MCVC 64- gcc unix. , .
, , , , "" . , , , , , - .
, ,
: , ( ) .
, Boost (, Linux/GCC Windows/MSVC). , .h, , .
.h
, , , , .
, Windows API, .
/ Visual Studio, , gcc () , , gcc Linux, Visual Studio .
, - - , , , , , .
, . , VC, gcc, intel, pgi. , . , , . , , .
:
static_cast<>, dynamic_cast<> const_cast<> C. reinterpret_cast<>, . ( , .)
static_cast<>
dynamic_cast<>
const_cast<>
reinterpret_cast<>
++: , MS, (brrr!) MFC CString.
CString
, , (, # 16 , # 18 STL ).
From the Linux development experience among Windows developers, the main problem usually (assuming you really don't use platform-specific code, as you say) is simply case sensitivity in #include names. In addition, you will find that gcc is stricter by default than MSVC, and you may need to pull it up a bit, but they are usually pretty simple.
Of particular note is that the std::map::eraseiterator does not return .
std::map::erase