根據我對msvc系列和mingw編譯器的了解
具體差異如下:
1.在編譯源文件過程中,2者對涉及的相關頭文件有所不同
比如:
#ifdef G_MSVC
#include <GEngine/Template/Vector.hpp>
#endif
這是蓋莫引擎中math.hpp包含的頭文件
其中有一個函數:
////////////////////////////////////////////////////////
/// 給定差量t(0<=t<=1)獲取線性插值點p(0) = p1,p(1) = p2
////////////////////////////////////////////////////////
template<class T>
static Vector3<T> GetPoint(const Vector3<T> &from,const Vector3<T> &to,float t);
在編譯的Math的時候MinGW需要先"編譯"Vector文件
2.2者在處理函數返回值上的不同
比如:
int GetValue()
{
}
msvc需要顯式的給定函數返回值
而mingw不需要(具有默認值)
3.對待函數參數的不同
比如
template<class T>
void Add(T a,T a);
4.基本數據結構類型有所不同
5.在獲取原始數據上的區別如下:
const int MAXINT = std::numeric_limits<int>::max;
const double MAXDOUBLE = (std::numeric_limits<double>::max)();
6.其他請大家補充吧