Reputation: 485
I'm working in Visual Studio 2015 and creating some projects using std:: libraries, as well as c++11 features like "nullptr", "initializer list"s and "auto" keyword. I also use "stdafx" precompiled header. The std:: components that I use are: <vector>, <string>, <chrono>, <stdio>, <iomanip>, <iostream>, <fstream>, <strsafe>, <math.h>, <thread>, <mutex>, <ctime>
I'm going to provide my .h and .cpp codes for other people (who probably don't use VS2015) in the close future and there are some questions:
1) For what things should I have prepared before I start to provide them my code?
2) What should I keep in my mind if want my code to work properly in a Linux environment (using QtCreator) in the future?
3) These libraries that I mention, is this everything okay (compatible && portable) if I use them and if I want my code to be portable for linux and windows versions of QtCreator C++11 environment?
4) What can be wrong and what should I also keep in my mind?
Upvotes: 1
Views: 113
Reputation: 14589
QtCreator isn't linux environment, it is a portable. If your project is Qt-based , you can install mingw version of Qt SDK, It includes Creator allows (mostly) to emulate use of its analog on linux platform.
Portability defined not by IDE, but by toolchain you use, compiler, libraries, make utility.
Those names you had listed are header files, not libraries.
ISO C++ contains list of header files that should be supported by compatible compiler. You can check them here:
http://en.cppreference.com/w/cpp/header
thus math.h
is not a C++ header, replace it with <cmath>
, strsafe
is Microsoft header without any analog on other platforms, its usage should be replaced.
If project meant to be built on different platforms and it is not possible to implement all its functionality in same way on both, you should consider usage of toolchain that is able to configure your project for particular platform. E.g., cmake.
Upvotes: 5