我正在学习如何使用SDL2,我正在遵循LazyFoo的教程。
我已经从第50课下载了源代码,它教如何使用OpenGL与SDL2(链接到教程),并试图执行它,但我得到了很多错误,我不知道该怎么办!
错误如下:
Error 11 error LNK1120: 9 unresolved externals c:usersfelipeDesktopArquivosDrawing - Modeling - CodingVisual Studio 2013SDL2 Template1DebugSDL2 Template1.exe SDL2 Template1
Error 2 error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function "void __cdecl render(void)" (?render@@YAXXZ) c:UsersFelipeDesktopArquivosDrawing - Modeling - CodingVisual Studio 2013SDL2 Template1SDL2 Template150_SDL_and_opengl_2.obj SDL2 Template1
Error 3 error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "void __cdecl render(void)" (?render@@YAXXZ) c:UsersFelipeDesktopArquivosDrawing - Modeling - CodingVisual Studio 2013SDL2 Template1SDL2 Template150_SDL_and_opengl_2.obj SDL2 Template1
Error 4 error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function "bool __cdecl initGL(void)" (?initGL@@YA_NXZ) c:UsersFelipeDesktopArquivosDrawing - Modeling - CodingVisual Studio 2013SDL2 Template1SDL2 Template150_SDL_and_opengl_2.obj SDL2 Template1
Error 5 error LNK2019: unresolved external symbol __imp__glEnd@0 referenced in function "void __cdecl render(void)" (?render@@YAXXZ) c:UsersFelipeDesktopArquivosDrawing - Modeling - CodingVisual Studio 2013SDL2 Template1SDL2 Template150_SDL_and_opengl_2.obj SDL2 Template1
Error 6 error LNK2019: unresolved external symbol __imp__glGetError@0 referenced in function "bool __cdecl initGL(void)" (?initGL@@YA_NXZ) c:UsersFelipeDesktopArquivosDrawing - Modeling - CodingVisual Studio 2013SDL2 Template1SDL2 Template150_SDL_and_opengl_2.obj SDL2 Template1
Error 7 error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "bool __cdecl initGL(void)" (?initGL@@YA_NXZ) c:UsersFelipeDesktopArquivosDrawing - Modeling - CodingVisual Studio 2013SDL2 Template1SDL2 Template150_SDL_and_opengl_2.obj SDL2 Template1
Error 8 error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "bool __cdecl initGL(void)" (?initGL@@YA_NXZ) c:UsersFelipeDesktopArquivosDrawing - Modeling - CodingVisual Studio 2013SDL2 Template1SDL2 Template150_SDL_and_opengl_2.obj SDL2 Template1
Error 9 error LNK2019: unresolved external symbol __imp__glVertex2f@8 referenced in function "void __cdecl render(void)" (?render@@YAXXZ) c:UsersFelipeDesktopArquivosDrawing - Modeling - CodingVisual Studio 2013SDL2 Template1SDL2 Template150_SDL_and_opengl_2.obj SDL2 Template1
Error 10 error LNK2019: unresolved external symbol _gluErrorString@4 referenced in function "bool __cdecl initGL(void)" (?initGL@@YA_NXZ) c:UsersFelipeDesktopArquivosDrawing - Modeling - CodingVisual Studio 2013SDL2 Template1SDL2 Template150_SDL_and_opengl_2.obj SDL2 Template1
Warning 1 warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library c:UsersFelipeDesktopArquivosDrawing - Modeling - CodingVisual Studio 2013SDL2 Template1SDL2 Template1MSVCRTD.lib(cinitexe.obj) SDL2 Template1
我从未使用过OpenGL,所以我不知道发生了什么。
这是什么意思?我该如何解决这个问题?
看起来你丢失了一个库文件,很可能是OpenGL32.lib。如果您有可用的库,请将其添加到您的项目中。
查看此页面,靠近底部:http://msdn.microsoft.com/en-us/library/windows/desktop/dd318361(v=vs.85).aspx