• Advertisement

Archived

This topic is now archived and is closed to further replies.

Please help a newbie!

This topic is 5923 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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 =-

Share this post


Link to post
Share on other sites
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/

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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




Share this post


Link to post
Share on other sites

  • Advertisement