我有一個項目在glfw,我在codeblocks中創建,因爲我一直想嘗試visual studio我決定轉移它,代碼編譯罰款當在代碼塊中運行時。然而在visual studio中,我得到以下錯誤:錯誤從代碼塊到視覺工作室(glfw/glew)
Error 1 error LNK2019: unresolved external symbol [email protected] referenced in function "void __cdecl Main_Loop(void)" ([email protected]@YAXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 2 error LNK2019: unresolved external symbol [email protected] referenced in function "void __cdecl Init(void)" ([email protected]@YAXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 3 error LNK2019: unresolved external symbol [email protected] referenced in function "void __cdecl Init(void)" ([email protected]@YAXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 4 error LNK2019: unresolved external symbol [email protected] referenced in function "void __cdecl Draw(class TextRenderer,class Button)" ([email protected]@[email protected]@[email protected]@@Z) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 5 error LNK2001: unresolved external symbol [email protected] c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 6 error LNK2019: unresolved external symbol [email protected] referenced in function "void __cdecl Init(void)" ([email protected]@YAXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 7 error LNK2019: unresolved external symbol [email protected] referenced in function "void __cdecl Draw(class TextRenderer,class Button)" ([email protected]@[email protected]@[email protected]@@Z) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 8 error LNK2019: unresolved external symbol [email protected] referenced in function "void __cdecl glInit(void)" ([email protected]@YAXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 9 error LNK2019: unresolved external symbol [email protected] referenced in function "void __cdecl glInit(void)" ([email protected]@YAXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 10 error LNK2019: unresolved external symbol _glfwInit referenced in function "void __cdecl Init(void)" ([email protected]@YAXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 11 error LNK2019: unresolved external symbol _glfwTerminate referenced in function "void __cdecl Shut_Down(int)" ([email protected]@[email protected]) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 12 error LNK2019: unresolved external symbol _glfwOpenWindow referenced in function "void __cdecl Init(void)" ([email protected]@YAXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 13 error LNK2019: unresolved external symbol _glfwSetWindowTitle referenced in function "void __cdecl Init(void)" ([email protected]@YAXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 14 error LNK2019: unresolved external symbol _glfwSwapBuffers referenced in function "void __cdecl Main_Loop(void)" ([email protected]@YAXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 15 error LNK2019: unresolved external symbol _glfwGetWindowParam referenced in function "void __cdecl Main_Loop(void)" ([email protected]@YAXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 16 error LNK2019: unresolved external symbol __imp__FT_Init_FreeType referenced in function "void __cdecl fontInit(void)" ([email protected]@YAXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 17 error LNK2019: unresolved external symbol __imp__FT_New_Face referenced in function "void __cdecl fontInit(void)" ([email protected]@YAXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\main.obj Project1
Error 18 error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual void __thiscall Button::render(void)" ([email protected]@@UAEXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\Button.obj Project1
Error 19 error LNK2001: unresolved external symbol [email protected] c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 20 error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual void __thiscall Button::render(void)" ([email protected]@@UAEXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\Button.obj Project1
Error 21 error LNK2001: unresolved external symbol [email protected] c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 22 error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual void __thiscall Button::render(void)" ([email protected]@@UAEXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\Button.obj Project1
Error 23 error LNK2001: unresolved external symbol [email protected] c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 24 error LNK2019: unresolved external symbol [email protected] referenced in function "public: virtual void __thiscall Button::render(void)" ([email protected]@@UAEXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\Button.obj Project1
Error 25 error LNK2001: unresolved external symbol [email protected] c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 26 error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall TextRenderer::draw(struct FT_Bitmap_ *,float,float)" ([email protected]@@[email protected]@[email protected]) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 27 error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall TextRenderer::draw(struct FT_Bitmap_ *,float,float)" ([email protected]@@[email protected]@[email protected]) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 28 error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall TextRenderer::draw(struct FT_Bitmap_ *,float,float)" ([email protected]@@[email protected]@[email protected]) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 29 error LNK2019: unresolved external symbol __imp__glDi[email protected] referenced in function "public: void __thiscall TextRenderer::draw(struct FT_Bitmap_ *,float,float)" ([email protected]@@[email protected]@[email protected]) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 30 error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall TextRenderer::draw(struct FT_Bitmap_ *,float,float)" ([email protected]@@[email protected]@[email protected]) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 31 error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall TextRenderer::draw(struct FT_Bitmap_ *,float,float)" ([email protected]@@[email protected]@[email protected]) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 32 error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall TextRenderer::draw(struct FT_Bitmap_ *,float,float)" ([email protected]@@[email protected]@[email protected]) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 33 error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall TextRenderer::draw(struct FT_Bitmap_ *,float,float)" ([email protected]@@[email protected]@[email protected]) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 34 error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall TextRenderer::draw(struct FT_Bitmap_ *,float,float)" ([email protected]@@[email protected]@[email protected]) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 35 error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall TextRenderer::draw(struct FT_Bitmap_ *,float,float)" ([email protected]@@[email protected]@[email protected]) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 36 error LNK2019: unresolved external symbol [email protected] referenced in function "public: void __thiscall TextRenderer::draw(struct FT_Bitmap_ *,float,float)" ([email protected]@@[email protected]@[email protected]) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 37 error LNK2019: unresolved external symbol __imp__FT_Set_Char_Size referenced in function "public: __thiscall TextRenderer::TextRenderer(float,float,struct FT_FaceRec_ * *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,float)" ([email protected]@[email protected][email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 38 error LNK2019: unresolved external symbol __imp__FT_Load_Glyph referenced in function "public: virtual void __thiscall TextRenderer::render(void)" ([email protected]@@UAEXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 39 error LNK2019: unresolved external symbol __imp__FT_Get_Char_Index referenced in function "public: virtual void __thiscall TextRenderer::render(void)" ([email protected]@@UAEXXZ) c:\Users\Samuel\documents\visual studio 2012\Projects\Project1\Project1\TextRenderer.obj Project1
Error 40 error LNK1120: 34 unresolved externals c:\users\samuel\documents\visual studio 2012\Projects\Project1\Debug\Project1.exe Project1
這是什麼錯誤造成的?
編輯:根據你的反應看來,我是不正確的鏈接庫,現在我得到沒有上述錯誤的,但我得到一個新問題: 更多信息:
這是輸出視覺工作室是給我
'PROJECT1.EXE' 的(Win32):已加載 'C:\用戶\薩穆埃爾\文檔\ Visual Studio的 2012 \項目\ PROJECT1 \調試\ PROJECT1.EXE'。符號加載。 'Project1.exe'(Win32):Loaded'C:\ Windows \ SysWOW64 \ ntdll.dll'。 找不到或打開PDB文件。 'Project1.exe'(Win32):Loaded'C:\ Program Files \ AVAST Software \ Avast \ snxhk.dll'。無法找到或打開PDB 文件。 'Project1.exe'(Win32):加載 'C:\ Windows \ SysWOW64 \ kernel32.dll'。找不到或打開PDB文件。 'Project1.exe'(Win32):Loaded'C:\ Windows \ SysWOW64 \ KernelBase.dll'。 找不到或打開PDB文件。 'Project1.exe'(Win32):Loaded 'C:\ Windows \ SysWOW64 \ opengl32.dll'。找不到或打開PDB文件。 'Project1.exe'(Win32):Loaded'C:\ Windows \ SysWOW64 \ user32.dll'。 找不到或打開PDB文件。 'Project1.exe'(Win32):Loaded 'C:\ Windows \ glew32.dll'。模塊沒有符號。 'Project1.exe'(Win32):加載'C:\ Windows \ System \ freetype6.dll'。 模塊構建時沒有符號。 'Project1.exe'(Win32):Loaded 'C:\ Windows \ SysWOW64 \ msvcp110d.dll'。符號加載。 'Project1.exe' (Win32):加載'C:\ Windows \ SysWOW64 \ msvcr110d.dll'。符號加載。 'Project1.exe'(Win32):加載'C:\ Windows \ SysWOW64 \ msvcrt.dll'。 找不到或打開PDB文件。 'Project1.exe'(Win32):Loaded 'C:\ Windows \ SysWOW64 \ advapi32.dll'。找不到或打開PDB文件。 'Project1.exe'(Win32):Loaded'C:\ Windows \ SysWOW64 \ gdi32.dll'。 找不到或打開PDB文件。 'Project1.exe'(Win32):Loaded 'C:\ Windows \ SysWOW64 \ glu32.dll'。找不到或打開PDB文件。 'Project1.exe'(Win32):Loaded'C:\ Windows \ SysWOW64 \ ddraw.dll'。 找不到或打開PDB文件。 'Project1.exe'(Win32):Loaded 'C:\ Windows \ System \ zlib1.dll'。模塊沒有符號。 'Project1.exe'(Win32):加載'C:\ Windows \ SysWOW64 \ sechost.dll'。 找不到或打開PDB文件。 'Project1.exe'(Win32):Loaded 'C:\ Windows \ SysWOW64 \ rpcrt4.dll'。找不到或打開PDB文件。 'Project1.exe'(Win32):Loaded'C:\ Windows \ SysWOW64 \ dciman32.dll'。 找不到或打開PDB文件。 Project1.exe中0x77BEB0AE (ntdll.dll)的第一次機會異常:0xC0000139:找不到入口點。 程序'[9044] Project1.exe'已退出,代碼爲-1073741511 (0xc0000139)'未找到入口點'。
你需要鏈接庫,glfw,glew,opengl32,因爲你只包括頭文件和編譯器需要的二進制文件太 – UnknownError1337
http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved -external-symbol-error-and-how-do-i-fix – stijn
我以爲我有 - 我去了include目錄並添加了包含和lib文件夾,因爲它不允許我選擇單個文件 - 就像代碼塊 – user2673108