Presenting the Newbiest Newbie from Newbity-doobie land!

Started by
21 comments, last by TwistedMatrix 20 years, 9 months ago
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 =-
- Twisted Matrix
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]
Suffered seven plagues, but refused to let the slaves go free. ~ Ross Atherton
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."
My compiler generates one error message: "does not compile."
#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

Beginner in Game Development?  Read here. And read here.

 

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.
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 =-
- Twisted Matrix
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."
My compiler generates one error message: "does not compile."
I think you are not linking with the opengl libraries.
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 =-
- Twisted Matrix
Try including the following libraries

opengl32.lib glu32.lib glut.lib

This topic is closed to new replies.

Advertisement