Opengl: Missing a dll file!
Hello.
I have always been a DirectX person.
But I have recently founding a growing interest for OpenGL for 3d graphics!
I have 3 simple questions:
1) I downloaded GLUT (i think thats what it was), unzipped it, placed all the files into a directory, and then set my VC++ directory paths to that directory. When I build (a very simple opengl app) I get an error.
--------------------
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/OpenGL_Test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
OpenGL_Test.exe - 2 error(s), 0 warning(s)
---------------------
So what could my problem be here?
2) Can I use opengl for graphics and directsound and directinput in my game/demo?
3) What exactly is the difference between GLUT, GLUT32, GLU...etc and which one is best for making games/demos??
thanks.
~ I''''m a wannabe programmer ~
Hey man,
i have just recently started with opengl, and like you I am a direct x man. As for you''re missing dll, I dont know what it is. Doesnt look like it is missing any opengl stuff. Also, i am not using GLUT, Visual shouldnt need anything to be installed when using just OpenGL.
Make sure you have added the correct librarys, under projects and settings just in case or use the #pragma(lib...).
And yes you can use DirectInput and i am guessing DirectSound too, Go over to NeHe, he has some tutorials on using DIrectInput with OpenGl.
And as for GLUT, i dont know havent used it. I think it is just an extension for OpenGl. Hell i could be using it without knowing, i am new to this opengl stuff! Hope i helped a little, later-
what we do in life... echoes in eternity...
i have just recently started with opengl, and like you I am a direct x man. As for you''re missing dll, I dont know what it is. Doesnt look like it is missing any opengl stuff. Also, i am not using GLUT, Visual shouldnt need anything to be installed when using just OpenGL.
Make sure you have added the correct librarys, under projects and settings just in case or use the #pragma(lib...).
And yes you can use DirectInput and i am guessing DirectSound too, Go over to NeHe, he has some tutorials on using DIrectInput with OpenGl.
And as for GLUT, i dont know havent used it. I think it is just an extension for OpenGl. Hell i could be using it without knowing, i am new to this opengl stuff! Hope i helped a little, later-
what we do in life... echoes in eternity...
I do believe that the problem is that you haven''t linked in the OpenGL libraries. Try adding these lines to the top of your program:
#pragma comment( lib, "opengl32.lib" )
#pragma comment( lib, "glu32.lib" )
#pragma comment( lib, "glaux.lib" )
Yes you can use OpenGL for graphics and DirectX for sound and input. The book OpenGL Game Programming covers this (and many other useful topics), so you might want to pick up a copy of that.
GLUT is the OpenGL Utility Toolkit. It allows you to quickly and easily set up a rendering window, and do other things relatively easily. And its platform independent. GLUT32 is the Win32 version. For a beginner this may be the best route to learning OpenGL.
GLU (OpenGL Utilities...?) is a bunch useful functions that make life easier for a GL programmer (for example: gluPerspective()). Hope that helps.
--Buzzy
#pragma comment( lib, "opengl32.lib" )
#pragma comment( lib, "glu32.lib" )
#pragma comment( lib, "glaux.lib" )
Yes you can use OpenGL for graphics and DirectX for sound and input. The book OpenGL Game Programming covers this (and many other useful topics), so you might want to pick up a copy of that.
GLUT is the OpenGL Utility Toolkit. It allows you to quickly and easily set up a rendering window, and do other things relatively easily. And its platform independent. GLUT32 is the Win32 version. For a beginner this may be the best route to learning OpenGL.
GLU (OpenGL Utilities...?) is a bunch useful functions that make life easier for a GL programmer (for example: gluPerspective()). Hope that helps.
--Buzzy
1)
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/OpenGL_Test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
OpenGL_Test.exe - 2 error(s), 0 warning(s)
------
this is caused becuase instead of the int main() you need something simarl to this:
__stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLing, int ShowCmd)
but that still not work becuase from what i''m aware of, you need to compile the GLUT programs as a win32 console application and not win32 application, i could be mistaken.
2) you can use what ever you want with the opengl, but not direct3d, or another api similar to opengl. but in GLUT''s case it can be thought of as a wraper to the opengl so its ok.
3) GLUT is (win32?)linux/mac etc version, stands for Graphics Libary Utility Toolkit GLUT32 is the windows only version, GLU just extends the OpenGL, same with GLAUX, but generaly you never want to use AUX, but instead use GLUT.
i say glut is probaly the best for making a games/demo becuase all you have to worry about is GLUT and not what operating system your on for rendering.
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/OpenGL_Test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
OpenGL_Test.exe - 2 error(s), 0 warning(s)
------
this is caused becuase instead of the int main() you need something simarl to this:
__stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLing, int ShowCmd)
but that still not work becuase from what i''m aware of, you need to compile the GLUT programs as a win32 console application and not win32 application, i could be mistaken.
2) you can use what ever you want with the opengl, but not direct3d, or another api similar to opengl. but in GLUT''s case it can be thought of as a wraper to the opengl so its ok.
3) GLUT is (win32?)linux/mac etc version, stands for Graphics Libary Utility Toolkit GLUT32 is the windows only version, GLU just extends the OpenGL, same with GLAUX, but generaly you never want to use AUX, but instead use GLUT.
i say glut is probaly the best for making a games/demo becuase all you have to worry about is GLUT and not what operating system your on for rendering.
IMO, if you already know DX, avoid using GLUT altogether. Check out NeHe''s tuts for an idea of how to setup OpenGL using the win32 api and you should be soon on your way. GLUT is fine for small progs, demos and such, but it has it''s bugs. But if you prefer using a toolkit for instancing windows and menus, check out CPW, a GLUT alternative: http://www.mathies.com/cpw/
Are you sure your project is a Win32 Application???
If not that may be your problem...
If not that may be your problem...
His project is a Win32 Application, ''cause otherwise the linker wouldn''t complain about a missing WinMain.
Win32 Application uses WinMain() as entry point, and Win32 Console Application uses main() as entry point. Make sure you create the right project type depending on what entry point you have in your code.
You can also change this in the linker settings, but creating the proper project type from the beginning is probably the easiest way to get things correct.
Win32 Application uses WinMain() as entry point, and Win32 Console Application uses main() as entry point. Make sure you create the right project type depending on what entry point you have in your code.
You can also change this in the linker settings, but creating the proper project type from the beginning is probably the easiest way to get things correct.
And if you''re using glut, you should be creating your project as a Win32 Console Application. You''re currently using a Win32 Application, which is why you''re getting that linker error.
i am unfamiliar with using
------------------
#pragma comment( lib, "opengl32.lib" )
#pragma comment( lib, "glu32.lib" )
#pragma comment( lib, "glaux.lib" )
-----------------
what does #pragma comment(...) do???
~ I am a DirectX to OpenGL convert! ~
------------------
#pragma comment( lib, "opengl32.lib" )
#pragma comment( lib, "glu32.lib" )
#pragma comment( lib, "glaux.lib" )
-----------------
what does #pragma comment(...) do???
~ I am a DirectX to OpenGL convert! ~
pragma comment(lib, "libname") directs the linker to link the "libname" lib file in with the executable. IIRC its specific to MSVC.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement