2013-08-20 71 views
-1

我有一个项目在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 

这是什么错误造成的?

编辑:根据你的反应看来,我是不正确的链接库,现在我得到没有上述错误的,但我得到一个新问题: Error 更多信息:

这是输出视觉工作室是给我

'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)'未找到入口点'。

+1

你需要链接库,glfw,glew,opengl32,因为你只包括头文件和编译器需要的二进制文件太 – UnknownError1337

+0

http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved -external-symbol-error-and-how-do-i-fix – stijn

+0

我以为我有 - 我去了include目录并添加了包含和lib文件夹,因为它不允许我选择单个文件 - 就像代码块 – user2673108

回答

2

根据对问题的评论,我想我可以提供一个体面的答案。你需要链接一些库(glfw,glew,opengl23)。在Visual Studio中,添加库是在项目属性的Linker部分完成的。更具体地说:Properties > Linker > Input > Additional Dependencies

可以在Properties > Linker > General > Additional Library Directories处添加库的其他搜索目录。