Я встречал ошибки LNK в своем проекте opengl, но не знаю, как с ними бороться
мои головные файлы выглядят следующим образом:
#include "stdafx.h" #include <gl\glew-2.0.0-x86\include\GL\glew.h> #include <gl\glut.h> #include <gl\glfw_app.hpp> #include <gl\gl_shader.hpp> #include <gl\gl_macros.hpp> #define GLM_FORCE_RADIANS #include <gl\glm\glm.hpp> #include <gl\glm\gtc\matrix_transform.hpp> #include <gl\glm\gtc\type_ptr.hpp> #include <vector> using namespace lynda; using namespace std;
А ошибки:
Severity Code Description Project File Line Warning C4800 'int': forcing value to bool 'true' or 'false' (performance warning) OpenGL_2 h:\visual studio\vc\include\gl\glfw_window.hpp 106 Error LNK1120 42 unresolved externals OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\Debug\OpenGL_2.exe 1 Warning LNK4272 library machine type 'x64' conflicts with target machine type 'X86' OpenGL_2 H:\opencv\opencv\build\x64\vc14\lib\opencv_world310.lib 1 Warning LNK4272 library machine type 'x64' conflicts with target machine type 'X86' OpenGL_2 H:\opencv\opencv\build\x64\vc14\lib\opencv_world310d.lib 1 Error LNK2019 unresolved external symbol _glfwCreateWindow referenced in function "public: void __thiscall lynda::Window::create<struct lynda::App>(struct lynda::App *,int,int,char const *)" (??$create@UApp@lynda@@@Window@lynda@@QAEXPAUApp@1@HHPBD@Z) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol _glfwDestroyWindow referenced in function "public: void __thiscall lynda::Window::destroy(void)" (?destroy@Window@lynda@@QAEXXZ) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol _glfwGetFramebufferSize referenced in function "public: void __thiscall lynda::Window::setViewport(void)" (?setViewport@Window@lynda@@QAEXXZ) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol _glfwInit referenced in function "public: __thiscall lynda::App::App(int,int)" (??0App@lynda@@QAE@HH@Z) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol _glfwMakeContextCurrent referenced in function "public: void __thiscall lynda::Window::create<struct lynda::App>(struct lynda::App *,int,int,char const *)" (??$create@UApp@lynda@@@Window@lynda@@QAEXPAUApp@1@HHPBD@Z) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol _glfwPollEvents referenced in function "public: void __thiscall lynda::App::start(void)" (?start@App@lynda@@QAEXXZ) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol _glfwSetCursorPosCallback referenced in function "public: void __thiscall lynda::Window::create<struct lynda::App>(struct lynda::App *,int,int,char const *)" (??$create@UApp@lynda@@@Window@lynda@@QAEXPAUApp@1@HHPBD@Z) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol _glfwSetKeyCallback referenced in function "public: void __thiscall lynda::Window::create<struct lynda::App>(struct lynda::App *,int,int,char const *)" (??$create@UApp@lynda@@@Window@lynda@@QAEXPAUApp@1@HHPBD@Z) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol _glfwSetMouseButtonCallback referenced in function "public: void __thiscall lynda::Window::create<struct lynda::App>(struct lynda::App *,int,int,char const *)" (??$create@UApp@lynda@@@Window@lynda@@QAEXPAUApp@1@HHPBD@Z) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol _glfwSwapBuffers referenced in function "public: void __thiscall lynda::Window::swapBuffers(void)" (?swapBuffers@Window@lynda@@QAEXXZ) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol _glfwSwapInterval referenced in function "public: void __thiscall lynda::Window::create<struct lynda::App>(struct lynda::App *,int,int,char const *)" (??$create@UApp@lynda@@@Window@lynda@@QAEXPAUApp@1@HHPBD@Z) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol _glfwTerminate referenced in function "public: void __thiscall lynda::Window::create<struct lynda::App>(struct lynda::App *,int,int,char const *)" (??$create@UApp@lynda@@@Window@lynda@@QAEXPAUApp@1@HHPBD@Z) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol _glfwWindowShouldClose referenced in function "public: bool __thiscall lynda::Window::shouldClose(void)" (?shouldClose@Window@lynda@@QAE_NXZ) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp__glewExperimental OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol __imp__glewGetErrorString@4 referenced in function "public: __thiscall lynda::App::App(int,int)" (??0App@lynda@@QAE@HH@Z) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2019 unresolved external symbol __imp__glewInit@0 referenced in function "public: __thiscall lynda::App::App(int,int)" (??0App@lynda@@QAE@HH@Z) OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewAttachShader OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewBindBuffer OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewBindVertexArray OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewBindVertexArrayAPPLE OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewBufferData OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewCompileShader OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewCreateProgram OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewCreateShader OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewEnableVertexAttribArray OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewGenBuffers OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewGenVertexArrays OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewGenVertexArraysAPPLE OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewGetAttribLocation OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewGetProgramInfoLog OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewGetProgramiv OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewGetShaderInfoLog OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewGetShaderiv OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewGetUniformLocation OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewLinkProgram OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewShaderSource OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewUniformMatrix4fv OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewUseProgram OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewValidateProgram OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____glewVertexAttribPointer OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____GLEW_APPLE_vertex_array_object OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1 Error LNK2001 unresolved external symbol __imp____GLEW_ARB_vertex_array_object OpenGL_2 C:\Users\Sar.Kerson\Desktop\OpenGL_2\OpenGL_2\OpenGL_2.obj 1
Что я уже пробовал:
Я изменил порядок своих головных файлов, но это, похоже, не внесло никакого вклада.
Как он может это сделать?