Jump to content
  • Advertisement

Archived

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

TwistedMatrix

Presenting the Newbiest Newbie from Newbity-doobie land!

This topic is 5493 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 everyone. I think i''m going to be hanging around these boards more often. This is my first post though. Here is the scoop. I am 17 now. I have been doing dos programming my whole life. particularly quickbasic and asm programming, but i dabbled in c(DJGPP). I recently waded into windows with some VB6 and BlitzBasic/DarkBasic (I will be suprised if people here even knows the blasphemy that is DarkBasic) ANyways, I really want to use c++ and OpenGL because I am so tired of being limited. So: I downloaded DevC++, OpenGL2, and GLUT and I am very disappointed. So far I have hardly been able to complile ANYTHING. None of the Glut or ogl examples will work. Even the "Hello-world" program that comes with DevC++ wouldnt compile! I don''t have the money for VC++ and im a complete dumbass. What am i going to do!?!?!??!! -= Twisted Matrix =-

Share this post


Link to post
Share on other sites
Advertisement
here is a nice c++ WIN32 and OpenGL tutorial site:

GameTutorials.com

Use it. The people there are really helpful

Jeff D

EDIT: I don't know much about DevC++ but I do know that you need to include stdio.h and add system("PAUSE"); before return 0;
at the end of your main function hope that helped you



[edited by - Jeff D on October 22, 2002 4:43:04 PM]

Share this post


Link to post
Share on other sites
quote:

Even the "Hello-world" program that comes with DevC++ wouldnt compile!



It''s probably because of the settings of the compiler you use. Sorry, but I don''t use DevC++, can''t help any further.


My compiler generates one error message: "does not compile."

Share this post


Link to post
Share on other sites

#include <stdio.h>
#include <stdlib.h>

int main
{
printf("Hello World\n");
printf("This is my first program.");

system("PAUSE");
return 0;
}

/*C version of Hello World above*/

#include <iostream>
#include <stdlib.h>

using namespace std;

int main
{
cout << "Hello World" << endl;
cout << "This is my first program.";

system("PAUSE");
return 0;
}

//C++ version of Hello World above



These two programs should work with Dev-C++ or any C/C++ compiler. Also for OpenGL, you need to go the Bloodshed.net site and look for the section on how to setup the library for GL.

Any question feel free to ask

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hello,

Need more info. When you say it doesn''t compile what do you mean? I had a problem with dev-c++ where the compile would just hang and do nothing, never new why just downloaded the most recent version and it worked.

Share this post


Link to post
Share on other sites
They say DevC++ and MinGW (They come in a package. IDE and c++ compiler), are supposed to be the next best *free* thing to VC++.

Thanks Jeff. No that dosent really help. I seem to be having problems with linking. here are a few average errors for ya...

Generated by the OpenGL demo, fullscreen.c
-----------------------------------------------------------------
c:\windows\TEMP\ccR11xfb.o(.text+0x334):fullsc~1.c: undefined reference to `glClear@4''
c:\windows\TEMP\ccR11xfb.o(.text+0x395):fullsc~1.c: undefined reference to `glColor3f@12''
c:\windows\TEMP\ccR11xfb.o(.text+0x3b6):fullsc~1.c: undefined reference to `glColor3f@12''
c:\windows\TEMP\ccR11xfb.o(.text+0x426):fullsc~1.c: undefined reference to `glColor3f@12''
c:\windows\TEMP\ccR11xfb.o(.text+0x43d):fullsc~1.c: undefined reference to `glColor3f@12''
c:\windows\TEMP\ccR11xfb.o(.text+0x46b):fullsc~1.c: undefined reference to `glRecti@16''
c:\windows\TEMP\ccR11xfb.o(.text+0x536):fullsc~1.c: undefined reference to `glColor3f@12''
c:\windows\TEMP\ccR11xfb.o(.text+0x55e):fullsc~1.c: undefined reference to `glFlush@0''
c:\windows\TEMP\ccR11xfb.o(.text+0x56c):fullsc~1.c: undefined reference to `SwapBuffers@4''
c:\windows\TEMP\ccR11xfb.o(.text+0xa87):fullsc~1.c: undefined reference to `ChoosePixelFormat@8''
c:\windows\TEMP\ccR11xfb.o(.text+0xac0):fullsc~1.c: undefined reference to `SetPixelFormat@12''
c:\windows\TEMP\ccR11xfb.o(.text+0xaf3):fullsc~1.c: undefined reference to `DescribePixelFormat@16''
c:\windows\TEMP\ccR11xfb.o(.text+0xb80):fullsc~1.c: undefined reference to `wglCreateContext@4''
c:\windows\TEMP\ccR11xfb.o(.text+0xb9a):fullsc~1.c: undefined reference to `wglMakeCurrent@8''
c:\windows\TEMP\ccR11xfb.o(.text+0xcd8):fullsc~1.c: undefined reference to `wglMakeCurrent@8''
c:\windows\TEMP\ccR11xfb.o(.text+0xcfc):fullsc~1.c: undefined reference to `wglDeleteContext@4''
-----------------------------------------------------------------

-= Twisted Matrix =-

Share this post


Link to post
Share on other sites
quote:
Original post by TwistedMatrix
Generated by the OpenGL demo, fullscreen.c
-----------------------------------------------------------------
c:\windows\TEMP\ccR11xfb.o(.text+0x334):fullsc~1.c: undefined reference to `glClear@4''
c:\windows\TEMP\ccR11xfb.o(.text+0x395):fullsc~1.c: undefined reference to `glColor3f@12''
c:\windows\TEMP\ccR11xfb.o(.text+0x3b6):fullsc~1.c: undefined reference to `glColor3f@12''
...
-----------------------------------------------------------------


Looks like an #include problem for me...



My compiler generates one error message: "does not compile."

Share this post


Link to post
Share on other sites
Granted I have know Idea what Im doing. but "fullscreen.c" has 3 include lines.

#include <windows.h>
#include <GL/glut.h>
#include <stdio.h>

and in glut.h, some libraries appear to already be linked.

/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
in your compile preprocessor options. */
# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
/* To enable automatic SGI OpenGL for Windows library usage for GLUT,
define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */
# ifdef GLUT_USE_SGI_OPENGL
# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */
# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */
# pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */
# else
# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */
# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
# endif
# endif


anyways, how am I supposed to know what files to link to a given program I am running. I mean, All the error I am geting is "undefined referance to blah();" Mabey If i knew every all of the functions in every LIB I could pipoint which file I am not linking or whatever.

I have no idea...

-= Twisted Matrix =-

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Try including the following libraries

opengl32.lib glu32.lib glut.lib

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!