Please help a newbie!

Started by
5 comments, last by ChristopherVigren 22 years, 2 months ago
Hi! I try to write a OpenGl program with Microsoft Visual C++. I have added OpenGL32.lib, GLu32.lib and GLaux.lib before kernel32.lib in the "Object/library modules" field under the Link-tab in the Project Settings. Then I wrote this code: #include <windows.h> #include <gl\gl.h> #include <gl\glu.h> #include <gl\glaux.h> When I try to build the program, I get this error message: --------------------Configuration: OpenGL - Win32 Debug-------------------- Linking... LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/OpenGL.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. OpenGL.exe - 2 error(s), 0 warning(s) What have I done wrong?? All the files exist. Best Regards / Christopher Vigren
Best Regards/ Christopher Vigren
Advertisement
im not sure if the lib files are case senstitive but they vary well may be, i have it written
quote:opengl32.lib glu32.lib glaux.lib
in my lib files and the includes are the same as yours, and mine works also, maybe you just have to be careful of cases, but im not exactly sure

,Matt

-= kill one, your a murderer, kill thousands your a conquerer =-
-= kill one you're a murderer, kill thousands you're a conquerer =-
It''s not a case sensitive problem.

In fact, your program is console application and your program is configured like a windows application.

For changing this :

Press "Alt-F7"

Choose "Link" tab

Change "susbsystem:windows" by "subsystem:console"

========================
Leyder Dylan
http://ibelgique.ifrance.com/Slug-Production/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/
Sorry, I''ve made a mistake.

Change "subsystem:windows" by "subsystem:console"

========================
Leyder Dylan
http://ibelgique.ifrance.com/Slug-Production/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/

Maybe it''s time to get that Forum FAQ to work.

It should have this topic plus:

Including libs properly
Making sure latest DirectX sdk is installed

These are probably the most often asked questions I see.

You get that error because it can''t find WinMain() I believe.

int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow){return(0);} 


should let it compile alright. The program won''t do anything, but it will compile.

-Mezz
Thank you Leyder Dylan that Change "subsystem:windows" by "subsystem:console" did help me in finishing one problem that i was having.

I do agree that that a faq would be helpful in this group

kevina




This topic is closed to new replies.

Advertisement