From: Tor L. <tm...@ik...> - 2004-10-03 23:44:05
|
Karthik Kumar writes: > For my OpenGL application, I want to link dynamically against > opengl32.dll , provided by my vendor instead of libopengl32.a , > as part of the OpenGL SDK. Eh? opengl32.dll is provided by Microsoft. libopengl32.a is just the import library for it. > gcc.exe Debug/openltest.o -o "Debug\dlltest.exe" > -L"C:/Programs/Dev-Cpp/lib" -mwindows > C:/WINDOWS/system32/opengl32.dll > > Debug/openltest.o(.text+0x39):openltest.c: undefined reference to > `glGetIntegerv@8' Use the import library, -lopengl32, that's what it's there for. > Can anyone help me how to dynamically link my OpenGL applications > with the dll provided by my vendor. Somehow your wording sounds a bit odd. Binding to a DLL at link time (normally by specifying an import library, although in some cases the GNU linker can handle the DLL directly) is what one normally does on Windows. Yes, DLLs are shared libraries, a.k.a. dynamic libraries. But when talking about dynamic linking to a DLL, one probably means loading the DLL at run-time (LoadLibrary, then GetProcAddress to look up the entry points in it) (not specifying it at all at link-time). Maybe what you actually are trying to do would be to load the hardware-specific ICD at run-time? (For instance, for nVIDIA cards, it's called nvoglnt.dll.) Sorry, I don't have any experience of that. Using the normal OpenGL functions in opengl32.dll, and then looking up extensions through wglGetProcAddress is the normal way to do things, I would say. (As I said in my reply to your previous question, one can use a wrapper library like glew to hide the complexities.) --tml |