-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Export for DLL (shared MSVC build) #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-fix include path and header extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also its added warnings: C4251
Also warnings must be fixed.
Full compiler error log:
:\Users\Orange\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe --build C:\Users\Orange\CLionProjects\omath2\cmake-build\build\windows-release --target omath -j 6 [1/7] Building CXX object CMakeFiles\omath.dir\source\pathfinding\NavigationMesh.cpp.obj FAILED: CMakeFiles/omath.dir/source/pathfinding/NavigationMesh.cpp.obj C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx86\x86\cl.exe /nologo /TP -DOMATH_EXPORT -IC:\Users\Orange\CLionProjects\omath2\include /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c latest -MD /Zc:static_assert- /W4 /WX /showIncludes /FoCMakeFiles\omath.dir\source\pathfinding\NavigationMesh.cpp.obj /FdCMakeFiles\omath.dir\omath.pdb /FS -c C:\Users\Orange\CLionProjects\omath2\source\pathfinding\NavigationMesh.cpp C:\Users\Orange\CLionProjects\omath2\include\omath/pathfinding/NavigationMesh.hpp(37): error C2220: the following warning is treated as an error C:\Users\Orange\CLionProjects\omath2\include\omath/pathfinding/NavigationMesh.hpp(37): warning C4251: 'omath::pathfinding::NavigationMesh::m_verTextMap': 'std::unordered_map<omath::Vector3,std::vector<omath::Vector3,std::allocator<omath::Vector3>>,std::hash<omath::Vector3>,std::equal_to<omath::Vector3>,std::allocator<std::pair<const omath::Vector3,std::vector<omath::Vector3,std::allocator<omath::Vector3>>>>>' needs to have dll-interface to be used by clients of 'omath::pathfinding::NavigationMesh' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\unordered_map(61): note: see declaration of 'std::unordered_map<omath::Vector3,std::vector<omath::Vector3,std::allocator<omath::Vector3>>,std::hash<omath::Vector3>,std::equal_to<omath::Vector3>,std::allocator<std::pair<const omath::Vector3,std::vector<omath::Vector3,std::allocator<omath::Vector3>>>>>' [2/7] Building CXX object CMakeFiles\omath.dir\source\pathfinding\Astar.cpp.obj FAILED: CMakeFiles/omath.dir/source/pathfinding/Astar.cpp.obj C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx86\x86\cl.exe /nologo /TP -DOMATH_EXPORT -IC:\Users\Orange\CLionProjects\omath2\include /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c latest -MD /Zc:static_assert- /W4 /WX /showIncludes /FoCMakeFiles\omath.dir\source\pathfinding\Astar.cpp.obj /FdCMakeFiles\omath.dir\omath.pdb /FS -c C:\Users\Orange\CLionProjects\omath2\source\pathfinding\Astar.cpp C:\Users\Orange\CLionProjects\omath2\include\omath\pathfinding\NavigationMesh.hpp(37): error C2220: the following warning is treated as an error C:\Users\Orange\CLionProjects\omath2\include\omath\pathfinding\NavigationMesh.hpp(37): warning C4251: 'omath::pathfinding::NavigationMesh::m_verTextMap': 'std::unordered_map<omath::Vector3,std::vector<omath::Vector3,std::allocator<omath::Vector3>>,std::hash<omath::Vector3>,std::equal_to<omath::Vector3>,std::allocator<std::pair<const omath::Vector3,std::vector<omath::Vector3,std::allocator<omath::Vector3>>>>>' needs to have dll-interface to be used by clients of 'omath::pathfinding::NavigationMesh' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\unordered_map(61): note: see declaration of 'std::unordered_map<omath::Vector3,std::vector<omath::Vector3,std::allocator<omath::Vector3>>,std::hash<omath::Vector3>,std::equal_to<omath::Vector3>,std::allocator<std::pair<const omath::Vector3,std::vector<omath::Vector3,std::allocator<omath::Vector3>>>>>' [3/7] Building CXX object CMakeFiles\omath.dir\source\prediction\Projectile.cpp.obj FAILED: CMakeFiles/omath.dir/source/prediction/Projectile.cpp.obj C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx86\x86\cl.exe /nologo /TP -DOMATH_EXPORT -IC:\Users\Orange\CLionProjects\omath2\include /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c latest -MD /Zc:static_assert- /W4 /WX /showIncludes /FoCMakeFiles\omath.dir\source\prediction\Projectile.cpp.obj /FdCMakeFiles\omath.dir\omath.pdb /FS -c C:\Users\Orange\CLionProjects\omath2\source\prediction\Projectile.cpp C:\Users\Orange\CLionProjects\omath2\include\omath/Mat.hpp(320): error C2220: the following warning is treated as an error C:\Users\Orange\CLionProjects\omath2\include\omath/Mat.hpp(320): warning C4251: 'omath::Mat<Rows,Columns,Type,StoreType>::m_data': 'std::array<Type,Rows*Columns>' needs to have dll-interface to be used by clients of 'omath::Mat<Rows,Columns,Type,StoreType>' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\array(406): note: see declaration of 'std::array<Type,Rows*Columns>' C:\Users\Orange\CLionProjects\omath2\include\omath/Mat.hpp(320): note: the template instantiation context (the oldest one first) is C:\Users\Orange\CLionProjects\omath2\include\omath/Mat.hpp(28): note: while compiling class template 'omath::Mat' [4/7] Building CXX object CMakeFiles\omath.dir\source\projection\Camera.cpp.obj FAILED: CMakeFiles/omath.dir/source/projection/Camera.cpp.obj C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx86\x86\cl.exe /nologo /TP -DOMATH_EXPORT -IC:\Users\Orange\CLionProjects\omath2\include /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c latest -MD /Zc:static_assert- /W4 /WX /showIncludes /FoCMakeFiles\omath.dir\source\projection\Camera.cpp.obj /FdCMakeFiles\omath.dir\omath.pdb /FS -c C:\Users\Orange\CLionProjects\omath2\source\projection\Camera.cpp C:\Users\Orange\CLionProjects\omath2\include\omath/Mat.hpp(320): error C2220: the following warning is treated as an error C:\Users\Orange\CLionProjects\omath2\include\omath/Mat.hpp(320): warning C4251: 'omath::Mat<Rows,Columns,Type,StoreType>::m_data': 'std::array<Type,Rows*Columns>' needs to have dll-interface to be used by clients of 'omath::Mat<Rows,Columns,Type,StoreType>' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\array(406): note: see declaration of 'std::array<Type,Rows*Columns>' C:\Users\Orange\CLionProjects\omath2\include\omath/Mat.hpp(320): note: the template instantiation context (the oldest one first) is C:\Users\Orange\CLionProjects\omath2\include\omath/Mat.hpp(28): note: while compiling class template 'omath::Mat' [5/7] Building CXX object CMakeFiles\omath.dir\source\engines\Source\Camera.cpp.obj FAILED: CMakeFiles/omath.dir/source/engines/Source/Camera.cpp.obj C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx86\x86\cl.exe /nologo /TP -DOMATH_EXPORT -IC:\Users\Orange\CLionProjects\omath2\include /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c latest -MD /Zc:static_assert- /W4 /WX /showIncludes /FoCMakeFiles\omath.dir\source\engines\Source\Camera.cpp.obj /FdCMakeFiles\omath.dir\omath.pdb /FS -c C:\Users\Orange\CLionProjects\omath2\source\engines\Source\Camera.cpp C:\Users\Orange\CLionProjects\omath2\include\omath/Mat.hpp(320): error C2220: the following warning is treated as an error C:\Users\Orange\CLionProjects\omath2\include\omath/Mat.hpp(320): warning C4251: 'omath::Mat<Rows,Columns,Type,StoreType>::m_data': 'std::array<Type,Rows*Columns>' needs to have dll-interface to be used by clients of 'omath::Mat<Rows,Columns,Type,StoreType>' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\array(406): note: see declaration of 'std::array<Type,Rows*Columns>' C:\Users\Orange\CLionProjects\omath2\include\omath/Mat.hpp(320): note: the template instantiation context (the oldest one first) is C:\Users\Orange\CLionProjects\omath2\include\omath/Mat.hpp(28): note: while compiling class template 'omath::Mat' [6/7] Building CXX object CMakeFiles\omath.dir\source\Matrix.cpp.obj FAILED: CMakeFiles/omath.dir/source/Matrix.cpp.obj C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx86\x86\cl.exe /nologo /TP -DOMATH_EXPORT -IC:\Users\Orange\CLionProjects\omath2\include /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c latest -MD /Zc:static_assert- /W4 /WX /showIncludes /FoCMakeFiles\omath.dir\source\Matrix.cpp.obj /FdCMakeFiles\omath.dir\omath.pdb /FS -c C:\Users\Orange\CLionProjects\omath2\source\Matrix.cpp C:\Users\Orange\CLionProjects\omath2\include\omath/Matrix.hpp(103): error C2220: the following warning is treated as an error C:\Users\Orange\CLionProjects\omath2\include\omath/Matrix.hpp(103): warning C4251: 'omath::Matrix::m_data': 'std::unique_ptr<float [],std::default_delete<float []>>' needs to have dll-interface to be used by clients of 'omath::Matrix' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\memory(3462): note: see declaration of 'std::unique_ptr<float [],std::default_delete<float []>>' ninja: build stopped: subcommand failed.
Create Export for DLL (shared MSVC build)