PDA

View Full Version : some problems with the libaries?



Triver
07-04-2010, 08:59 AM
hi there, im trying to learn opengl, so i found this (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=01) tutorial. im working on windows 7 and have installed visual studio 2010 with the microsoft sdk.

the first problem was, that i had no glaux.lib that is used in the tutorial but after doing some research i found out, that nobody uses that today and is apparently only used in lesson 6 of the tutorial, so i didn't try to get it from the internet and include it in the project.

so after that i made lesson 1 which was building up an opengl window. after writing the code from the tutorial i compiled the whole thing and i get these errors:
<div class="ubbcode-block"><div class="ubbcode-header">Click to reveal.. <input type="button" class="form-button" value="Show me!" onclick="toggle_spoiler(this, 'Yikes, my eyes!', 'Show me!')" />]<div style="display: none;">1>InitializeBuildStatus:
1> Touching "Debug\opengl project.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1>opengl.obj : error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__glHint@8 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__glDepthFunc@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__glClearDepth@8 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__glShadeModel@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__UnregisterClassW@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__DestroyWindow@4 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__ReleaseDC@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__MessageBoxW@16 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__ShowCursor@4 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__ChangeDisplaySettingsW@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__SetFocus@4 referenced in function "int __cdecl CreateGLWindow(wchar_t *,int,int,int,bool)" (?CreateGLWindow@@YAHPA_WHHH_N@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__SetForegroundWindow@4 referenced in function "int __cdecl CreateGLWindow(wchar_t *,int,int,int,bool)" (?CreateGLWindow@@YAHPA_WHHH_N@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function "int __cdecl CreateGLWindow(wchar_t *,int,int,int,bool)" (?CreateGLWindow@@YAHPA_WHHH_N@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function "int __cdecl CreateGLWindow(wchar_t *,int,int,int,bool)" (?CreateGLWindow@@YAHPA_WHHH_N@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__SetPixelFormat@12 referenced in function "int __cdecl CreateGLWindow(wchar_t *,int,int,int,bool)" (?CreateGLWindow@@YAHPA_WHHH_N@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__ChoosePixelFormat@8 referenced in function "int __cdecl CreateGLWindow(wchar_t *,int,int,int,bool)" (?CreateGLWindow@@YAHPA_WHHH_N@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__GetDC@4 referenced in function "int __cdecl CreateGLWindow(wchar_t *,int,int,int,bool)" (?CreateGLWindow@@YAHPA_WHHH_N@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__CreateWindowExW@48 referenced in function "int __cdecl CreateGLWindow(wchar_t *,int,int,int,bool)" (?CreateGLWindow@@YAHPA_WHHH_N@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__AdjustWindowRectEx@16 referenced in function "int __cdecl CreateGLWindow(wchar_t *,int,int,int,bool)" (?CreateGLWindow@@YAHPA_WHHH_N@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__RegisterClassW@4 referenced in function "int __cdecl CreateGLWindow(wchar_t *,int,int,int,bool)" (?CreateGLWindow@@YAHPA_WHHH_N@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__LoadCursorW@8 referenced in function "int __cdecl CreateGLWindow(wchar_t *,int,int,int,bool)" (?CreateGLWindow@@YAHPA_WHHH_N@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__LoadIconW@8 referenced in function "int __cdecl CreateGLWindow(wchar_t *,int,int,int,bool)" (?CreateGLWindow@@YAHPA_WHHH_N@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__GetModuleHandleW@4 referenced in function "int __cdecl CreateGLWindow(wchar_t *,int,int,int,bool)" (?CreateGLWindow@@YAHPA_WHHH_N@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__DefWindowProcW@16 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
1>opengl.obj : error LNK2019: unresolved external symbol __imp__SwapBuffers@4 referenced in function _WinMain@16
1>opengl.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageW@4 referenced in function _WinMain@16
1>opengl.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16
1>opengl.obj : error LNK2019: unresolved external symbol __imp__PeekMessageW@20 referenced in function _WinMain@16
1>MSVCRTD.lib(_error_.obj) : error LNK2019: unresolved external symbol __imp__WideCharToMultiByte@32 referenced in function "void __cdecl failwithmessage(void *,int,int,char const *)" (?failwithmessage@@YAXPAXHHPBD@Z)
1>MSVCRTD.lib(_error_.obj) : error LNK2019: unresolved external symbol __imp__IsDebuggerPresent@0 referenced in function "void __cdecl failwithmessage(void *,int,int,char const *)" (?failwithmessage@@YAXPAXHHPBD@Z)
1>MSVCRTD.lib(gs_report.obj) : error LNK2001: unresolved external symbol __imp__IsDebuggerPresent@0
1>MSVCRTD.lib(_error_.obj) : error LNK2019: unresolved external symbol __imp__MultiByteToWideChar@24 referenced in function "void __cdecl failwithmessage(void *,int,int,char const *)" (?failwithmessage@@YAXPAXHHPBD@Z)
1>MSVCRTD.lib(_error_.obj) : error LNK2019: unresolved external symbol __imp__RaiseException@16 referenced in function "int __cdecl DebuggerProbe(unsigned long)" (?DebuggerProbe@@YAHK@Z)
1>MSVCRTD.lib(_error_.obj) : error LNK2019: unresolved external symbol __imp__lstrlenA@4 referenced in function "void __cdecl _RTC_AllocaFailure(void *,struct _RTC_ALLOCA_NODE *,int)" (?_RTC_AllocaFailure@@YAXPAXPAU_RTC_ALLOCA_NODE@@H @Z)
1>MSVCRTD.lib(_error_.obj) : error LNK2019: unresolved external symbol __imp__GetProcAddress@8 referenced in function "void __cdecl _RTC_AllocaFailure(void *,struct _RTC_ALLOCA_NODE *,int)" (?_RTC_AllocaFailure@@YAXPAXPAU_RTC_ALLOCA_NODE@@H @Z)
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2001: unresolved external symbol __imp__GetProcAddress@8
1>MSVCRTD.lib(_error_.obj) : error LNK2019: unresolved external symbol __imp__LoadLibraryW@4 referenced in function "void __cdecl _RTC_AllocaFailure(void *,struct _RTC_ALLOCA_NODE *,int)" (?_RTC_AllocaFailure@@YAXPAXPAU_RTC_ALLOCA_NODE@@H @Z)
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2001: unresolved external symbol __imp__LoadLibraryW@4
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol __imp__EncodePointer@4 referenced in function _pre_c_init
1>MSVCRTD.lib(atonexit.obj) : error LNK2001: unresolved external symbol __imp__EncodePointer@4
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol __imp__InterlockedExchange@8 referenced in function ___tmainCRTStartup
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol __imp__Sleep@4 referenced in function ___tmainCRTStartup
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol __imp__InterlockedCompareExchange@12 referenced in function ___tmainCRTStartup
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol __imp__HeapSetInformation@16 referenced in function ___tmainCRTStartup
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol __imp__GetStartupInfoW@4 referenced in function ___tmainCRTStartup
1>MSVCRTD.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp__TerminateProcess@8 referenced in function ___report_gsfailure
1>MSVCRTD.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp__GetCurrentProcess@0 referenced in function ___report_gsfailure
1>MSVCRTD.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp__UnhandledExceptionFilter@4 referenced in function ___report_gsfailure
1>MSVCRTD.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp__SetUnhandledExceptionFilter@4 referenced in function ___report_gsfailure
1>MSVCRTD.lib(unhandld.obj) : error LNK2001: unresolved external symbol __imp__SetUnhandledExceptionFilter@4
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol __imp__HeapFree@12 referenced in function "int __cdecl _RTC_GetSrcLine(unsigned char *,wchar_t *,unsigned long,int *,wchar_t *,unsigned long)" (?_RTC_GetSrcLine@@YAHPAEPA_WKPAH1K@Z)
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol __imp__HeapAlloc@12 referenced in function "int __cdecl _RTC_GetSrcLine(unsigned char *,wchar_t *,unsigned long,int *,wchar_t *,unsigned long)" (?_RTC_GetSrcLine@@YAHPAEPA_WKPAH1K@Z)
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol __imp__GetProcessHeap@0 referenced in function "int __cdecl _RTC_GetSrcLine(unsigned char *,wchar_t *,unsigned long,int *,wchar_t *,unsigned long)" (?_RTC_GetSrcLine@@YAHPAEPA_WKPAH1K@Z)
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol __imp__GetModuleFileNameW@12 referenced in function "int __cdecl _RTC_GetSrcLine(unsigned char *,wchar_t *,unsigned long,int *,wchar_t *,unsigned long)" (?_RTC_GetSrcLine@@YAHPAEPA_WKPAH1K@Z)
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol __imp__VirtualQuery@12 referenced in function "int __cdecl _RTC_GetSrcLine(unsigned char *,wchar_t *,unsigned long,int *,wchar_t *,unsigned long)" (?_RTC_GetSrcLine@@YAHPAEPA_WKPAH1K@Z)
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol __imp__FreeLibrary@4 referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)
1>MSVCRTD.lib(atonexit.obj) : error LNK2019: unresolved external symbol __imp__DecodePointer@4 referenced in function __onexit
1>MSVCRTD.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp__QueryPerformanceCounter@4 referenced in function ___security_init_cookie
1>MSVCRTD.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp__GetTickCount@0 referenced in function ___security_init_cookie
1>MSVCRTD.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp__GetCurrentThreadId@0 referenced in function ___security_init_cookie
1>MSVCRTD.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp__GetCurrentProcessId@0 referenced in function ___security_init_cookie
1>MSVCRTD.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp__GetSystemTimeAsFileTime@4 referenced in function ___security_init_cookie
1>C:\Users\Triver\Documents\Visual Studio 2010\Projects\opengl project\Debug\opengl project.exe : fatal error LNK1120: 67 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.06
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/QUOTE]</div>

i think i linked and included everything correctly but i heard that the opengl libary of microsoft is very old (1.1 or something like this) and that i should get the version of 2.0 because in later versions i have to include some stuff in the source code that is not described in this tutorial (that was last changed in the year 2000). is that true?

hope you can help me :)

Triver
07-04-2010, 09:41 AM
ok i managed to solve it now, apparently i have included a false directory for the libaries so after correcting that it works.

but i still would like to know if i have to use the glaux or is there a better solution aviable that does the same?

also im interested in the answers of my previous question:
i heard that the opengl libary of microsoft is very old (1.1 or something like this) and that i should get the version of 2.0 because in later versions i have to include some stuff in the source code that is not described in this tutorial (that was last changed in the year 2000). is that true?

DmanPwns
07-04-2010, 10:38 AM
If you use Windows you can't just "download" higher OpenGL verions than 1.1 becausemicrosoft does not support it any more. However, your VGA supports higher OpenGL version you can use an extesion library. See here (http://lmgtfy.com/?q=GLEW).

NeHe (http://nehe.gamedev.net/?q=GLEW) tutorials use the GLaux library just to load .bmp textures. It is easy to write a bitmap(bmp)loading routine yourself( link (http://lmgtfy.com/?q=bitmap+loading+OpenGL)).

Alternatively, you can use DevIL (http://openil.sourceforge.net/).

Zarniwoop
07-04-2010, 01:00 PM
> i heard that the opengl libary of microsoft is very old... is that true?

Yes, it is true. Microsoft would prefer that you use the Windows-specific DX libraries (so your app isn't portable to other OS) rather than OpenGL, which can run almost anywhere.

However, you might want to google for wglGetProcAddress. You can use that to obtain function pointers to all the GL extension functions so you can use advanced GL features even in a Windows environment. What I do is write a windows-specific init function inside #ifdef _WIN32 which loads up all the proc addresses I need.

Hope that helps :)

kowal
07-04-2010, 02:07 PM
To use advanced features of OpenGL You must install drivers for your graphics card (from vendor).
Many people seem to forget about that.

Triver
07-05-2010, 03:53 AM
thx for the answers guys

seems like opengl is really complex :eek:
so for now i will only go through the tutorials and hope i can understand it... :D