我正在尝试用C导出为
MathGeoLib
从C_消耗的库。
到目前为止我写的代码:
#include "stdafx.h"
#include "MathGeoLib/MathGeoLib.h"
OBB* OptimalEnclosingOBB(const vec* pointArray, int numPoints)
{
const auto obb1 = OBB::OptimalEnclosingOBB(pointArray, numPoints);
const auto obb2 = new OBB(obb1);
return obb2;
}
stdafx.h文件:
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
但是当我编译时,我得到
the following error
即使我定义了
NOMINMAX
:
1>c:\build\mathgeolib\include\mathgeolib\geometry\quadtree.inl(699): error C2760: syntax error: unexpected token 'int', expected 'expression'
这就是Visual Studio 2017的发展方向:
https://github.com/juj/MathGeoLib/blob/master/src/Geometry/QuadTree.inl#L699
template<typename T>
int QuadTree<T>::NumNodes() const
{
return std::max<int>(0, nodes.size() - 3);
}
问题:
如何修复此错误?