使用GLM时出现链接错误。我在网上找不到任何东西。
// these are what I include
#include<glm/glm.hpp>
#include<glm/gtc/matrix_transform.hpp>
// works uncommented
glm::vec3 eye( 3.0, 3.0, 3.0 );
glm::vec3 center( 0, 0, 0 );
glm::vec3 up( 0.0, 0.0, 1.0 );
// doesn't work uncommended
glm::perspective( 40.0, 1.0, 1.0, 10.0 );
glm::lookAt( eye, center, up );
Error:
2>render_3d.lib(GE_Render3D.obj) : error LNK2019: unresolved external symbol "public: struct glm::tvec4<float,0> & __thiscall glm::tvec4<float,0>::operator=(struct glm::tvec4<float,0> const &)" (??4?$tvec4@M$0A@@glm@@QAEAAU01@ABU01@@Z) referenced in function "public: __thiscall glm::tmat4x4<float,0>::tmat4x4<float,0>(float const &)" (??0?$tmat4x4@M$0A@@glm@@QAE@ABM@Z)
2>render_3d.lib(GE_Render3D.obj) : error LNK2019: unresolved external symbol "public: struct glm::tvec4<double,0> & __thiscall glm::tvec4<double,0>::operator=(struct glm::tvec4<double,0> const &)" (??4?$tvec4@N$0A@@glm@@QAEAAU01@ABU01@@Z) referenced in function "public: __thiscall glm::tmat4x4<double,0>::tmat4x4<double,0>(double const &)" (??0?$tmat4x4@N$0A@@glm@@QAE@ABN@Z)
2>render_3d.lib(GE_Render3D.obj) : error LNK2019: unresolved external symbol "public: __thiscall glm::tmat4x4<double,0>::tmat4x4<double,0>(struct glm::tmat4x4<double,0> const &)" (??0?$tmat4x4@N$0A@@glm@@QAE@ABU01@@Z) referenced in function "struct glm::tmat4x4<double,0> __cdecl glm::perspectiveRH<double>(double,double,double,double)" (??$perspectiveRH@N@glm@@YA?AU?$tmat4x4@N$0A@@0@NNNN@Z)
2>render_3d.lib(GE_Render3D.obj) : error LNK2019: unresolved external symbol "public: __thiscall glm::tmat4x4<float,0>::tmat4x4<float,0>(struct glm::tmat4x4<float,0> const &)" (??0?$tmat4x4@M$0A@@glm@@QAE@ABU01@@Z) referenced in function "struct glm::tmat4x4<float,0> __cdecl glm::lookAtRH<float,0>(struct glm::tvec3<float,0> const &,struct glm::tvec3<float,0> const &,struct glm::tvec3<float,0> const &)" (??$lookAtRH@M$0A@@glm@@YA?AU?$tmat4x4@M$0A@@0@ABU?$tvec3@M$0A@@0@00@Z)