0

我想使用 cork 库(https://github.com/gilbo/cork)对网格执行布尔运算,并且该库在 windows7 64x 上的 MSVC2015 Visual C++ 的单独项目中编译并运行良好。

当我在使用其他库的当前项目中包含软木塞时,出现以下错误:

1>------ Rebuild All started: Project: QtGuiApplication2, Configuration: Release x64 ------
1>  Moc'ing QtGuiApplication2.h...
1>  Uic'ing QtGuiApplication2.ui...
1>  Rcc'ing QtGuiApplication2.qrc...
1>RCC : warning : No resources in 'E:\C++\VS2013 projects\QtGuiApplication32015\QtGuiApplication2\QtGuiApplication2.qrc'.
1>
1>  cork.cpp
1>C:\cork\src\math\vec.h(98): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(98): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(98): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(100): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(100): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(100): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(123): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(123): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(125): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(125): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(125): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(125): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(125): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(203): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(203): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(203): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(205): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(205): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(205): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(230): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(230): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(232): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(232): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(232): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(232): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(232): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(313): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(313): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(313): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(315): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(315): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(315): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(339): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(339): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(341): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(341): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(341): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(341): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(341): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(481): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(481): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(481): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(486): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(486): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(486): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(526): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(526): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(530): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(530): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(530): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(530): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(530): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(629): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(629): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(629): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(629): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(629): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(635): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(635): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(635): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(635): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(635): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(635): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(635): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(687): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(687): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(687): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(687): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(691): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(691): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(691): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(691): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(691): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(691): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(691): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(795): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(795): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(795): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(795): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(795): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(802): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(802): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(802): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(802): fatal error C1003: error count exceeds 100; stopping compilation
1>  files.cpp
1>C:\cork\src\math\vec.h(98): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(98): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(98): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(100): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(100): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(100): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(123): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(123): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(125): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(125): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(125): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(125): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(125): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(203): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(203): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(203): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(205): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(205): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(205): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(230): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(230): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(232): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(232): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(232): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(232): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(232): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(313): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(313): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(313): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(315): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(315): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(315): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(339): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(339): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(341): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(341): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(341): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(341): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(341): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(481): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(481): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(481): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(486): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(486): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(486): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(526): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(526): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(530): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(530): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(530): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(530): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(530): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(629): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(629): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(629): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(629): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(629): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(635): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(635): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(635): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(635): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(635): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(635): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(635): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(687): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(687): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(687): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(687): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(691): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(691): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(691): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(691): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(691): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(691): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(691): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(795): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(795): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(795): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(795): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(795): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(802): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(802): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(802): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(802): fatal error C1003: error count exceeds 100; stopping compilation
1>  ifs.cpp
1>C:\cork\src\math\vec.h(98): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(98): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(98): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(98): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(100): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(100): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(100): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(100): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(123): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(123): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(123): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(125): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(125): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(125): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(125): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(125): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(203): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(203): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(203): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(203): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(205): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(205): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(205): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(205): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(230): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(230): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(230): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(232): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(232): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(232): error C2923: 'Vec3': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(232): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(232): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(313): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(313): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(313): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(313): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(315): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(315): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(315): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(315): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(339): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(339): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(339): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(341): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(341): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(341): error C2923: 'Vec4': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(341): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(341): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(481): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(481): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(481): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(481): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(486): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(486): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(486): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(486): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(486): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(526): warning C4003: not enough actual parameters for macro 'max'
1>C:\cork\src\math\vec.h(526): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(526): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): warning C4003: not enough actual parameters for macro 'min'
1>C:\cork\src\math\vec.h(530): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(530): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(530): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(530): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(530): error C2143: syntax error: missing ';' before '{'
1>C:\cork\src\math\vec.h(530): error C2447: '{': missing function header (old-style formal list?)
1>C:\cork\src\math\vec.h(629): error C2988: unrecognizable template declaration/definition
1>  quantization.cpp
1>  log.cpp
1>  timer.cpp
1>  moc_QtGuiApplication2.cpp
1>  main.cpp
1>  mldivide_Cxx.cpp
1>  mldivide_Cxx_initialize.cpp
1>  mldivide_Cxx_terminate.cpp
1>  QtGuiApplication2.cpp
1>  rtGetInf.cpp
1>  rtGetNaN.cpp
1>  rt_nonfinite.cpp
1>  Test_Move.cpp
1>  Generating Code...
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

出现错误的代码如下:

template<class N>
inline Vec2<N> min(const Vec2<N> &lhs, const Vec2<N> &rhs);

知道为什么模板之间存在冲突以及如何解决这个问题吗?

4

1 回答 1

0

问题是没有在 C++ -> 处理器下的 MSVC 中导入属性。

于 2017-12-07T16:18:27.543 回答