opengl in visual c++ 6.0

opengl in visual c++ 6.0

Post by ada » Wed, 02 Oct 2002 00:57:22



I am a newbie to opengl and visual c++.  I bought the book Opengl Game
Programming.  I can hardly understand what the author is talking about
so I need some help. Here is my first program that I haveing troubles
with even getting to run.

// first app.cpp : Defines the entry point for the application.

// Hello, world! program

#define WIN32_LEAN_AND_MEAN                     // trim down the libraries used

#include <windows.h>

// the main entry point
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR
lpCmdLine, int nShowCmd)
{
        MessageBox(NULL, "\tHello, World!" , "My First Program", NULL);
        return 0;

Quote:}

here are the errors I am getting:

--------------------Configuration: first app - Win32
Debug--------------------
Linking...
LIBCMTD.lib(crt0.obj) : error LNK2001: unresolved external symbol
_main
Debug/first app.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

first app.exe - 2 error(s), 0 warning(s)

if someone could tell me how to get programs running it would be much
appreciated. Thanks

 
 
 

opengl in visual c++ 6.0

Post by Remedi » Sat, 05 Oct 2002 08:25:55



> I am a newbie to opengl and visual c++.  I bought the book Opengl Game
> Programming.  I can hardly understand what the author is talking about
> so I need some help. Here is my first program that I haveing troubles
> with even getting to run.

> // first app.cpp : Defines the entry point for the application.

> // Hello, world! program

> #define WIN32_LEAN_AND_MEAN                        // trim down the libraries used

> #include <windows.h>

> // the main entry point
> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR
> lpCmdLine, int nShowCmd)
> {
>    MessageBox(NULL, "\tHello, World!" , "My First Program", NULL);
>    return 0;

> }

> here are the errors I am getting:

> --------------------Configuration: first app - Win32
> Debug--------------------
> Linking...
> LIBCMTD.lib(crt0.obj) : error LNK2001: unresolved external symbol
> _main
> Debug/first app.exe : fatal error LNK1120: 1 unresolved externals
> Error executing link.exe.

> first app.exe - 2 error(s), 0 warning(s)

> if someone could tell me how to get programs running it would be much
> appreciated. Thanks

Usually when I get this kind of errors in the linking process it's
because your  editor hasn't a correct setting.
You have to look for the file LIBCMTD.lib and put the directory that
contains it in the library settings in the options menu of VC++.
You probably will get other errors like this, and you have to follow
the same procedure and include the file in your options including the
directory.

Remedios

 
 
 

1. OpenGL with Visual C++ 6.0

I am trying to write some C code using OpenGL libraries, and I've run into
several snags. I've blundered my way through most problems, like not having
the glut libraries listed for the linker to find them and such, but I'm
currently stuck with a problem I can't seem to fix. I have code that works
correctly on the UNIX terminals at my college campus, and when I bring in
the same code files to Visual C++ to work at home, they compile correctly
and build without errors.  However, when I run them, none of what is
supposed to be drawn in the GL window is displayed. It seems almost as if
none of the information is being sent to the display, because the window
that comes up simply contains whatever was showing in that place in the
display buffer at the time. The glClear command doesn't even clear the area
with the background color. Very strange...

Like I said, the code works perfectly on the UNIX machines, compiling with
g++ and all the needed GL and GLUT libraries.  I've downloaded all the SGI
GLUTs, and plugged them into the correct folders (I think...).  I tried
using the MS versions first, but couldn't seem to get them all to work
together happily...everything linking-wise seems okay with the SGI files.
It's just, when I run the programs, nothing displays.  This is true not just
for my programs, but for some other test code that came with Glut 3-6. If
anyone out there has an idea what might be going on, PLEASE let me know.

and I'll show you what I've done.

Thanks in advance,
Jeff Galle

2. FAQ ?

3. Using OpenGL/GLU in Visual C++ 6.0

4. Closest Point ON the surface to a fixed 3D point

5. OpenGL and MS Visual C++ 6.0

6. WWW art page (I'm new at this) forgotten URL

7. What's the best card aceleration to program under OpenGL and Visual C++ 6.0?

8. OpenGL programming in Borland C++ vs Visual C++

9. Visual C++ 6.0

10. ImageMagick linking problem with Visual C++ 6.0

11. Image Processing Algorithms in Visual C++ 6.0 (kalman filter + image subtraction using mean+ std deviation)

12. ImageMagick linking problem with Visual C++ 6.0