gilbo / cork

3D Boolean / CSG Library
Other
406 stars 173 forks source link

using cork in my own project #38

Closed majsad closed 6 years ago

majsad commented 6 years ago

cork works fine in its demo application: "wincork", but when I include it in my own project the compiler complains about vec.h as below:

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++\QtGuiApplication32015\QtGuiApplication2\QtGuiApplication2.qrc'. 1> 1> cork.cpp 1>C:\cork\src\math\vec.h(96): error C2988: unrecognizable template declaration/definition 1>C:\cork\src\math\vec.h(96): error C2059: syntax error: 'const' 1>C:\cork\src\math\vec.h(96): error C2065: 'N': undeclared identifier 1>C:\cork\src\math\vec.h(96): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N' 1>C:\cork\src\math\vec.h(96): error C2059: syntax error: ')' 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' . . .

I am using MSVC2015. The way I used cork in my project is that I gave the proper addresses in my project properties for linking and libraries, then I included all the files which are presented in the wincork demo project to my own project.

Any help is appreciated.

majsad commented 6 years ago

For anyone who might face the same issue:

After including all the files in the wincork demo into your own project, and in the project property including the proper Additional Include Directories and Additional Library Directories and Additional Dependencies, then you should not forget to copy the same properties under C/C++ -> Preprocessor to your own project.