Bloodshed Dev-C++ Compile problem.

I am using Bloodshed Dev-c++ program for compiling my program,

 // shortest.c
// The shortest OpenGL program possible
#include <windows.h> // Standard Window header requiredfor all programs
#include <conio.h> // Console I/O functions
#include <gl\gl.h> // OpenGL functions
#include <glaux.h> // AUX Library functions

 main() {
// These are the AUX functions to set up the win dow
auxInitDisplayMode(AUX_SINGLE | AUX_RGBA);
auxInitPosition(100,100,250,250);
auxInitWindow("My first OpenGL Program");
// These are the OpenGL functions that do something in the window

glClear(GL_COLOR_BUFFER_BIT);
glFlush();
// Stop and wait for a keypress
cprintf("Press any key to close the Window 
");
getch();
} 

and whenever I try to compile I get this message:

 line:                 File:           Message:
file not recognized | opengl32.lib  | File format not recognized
                    | Makefile.win  | [Build error] [Prodject1.exe]Error 1
 

What do I do?

if you use devcpp try to write in linker line:
-lopengl32 -lglu32 and so on…

That didn’t work, any other suggestions?

Are you using the openGL library that came with DEV-C++ or did you download one from somewhere else?

DEV-C++ librarys look like this:

libopengl32.a

Originally posted by Me6:
That didn’t work, any other suggestions?

I have used the ones that come with Dev-C++ and I got the error message:

auxInitDisplayMode
auxInitPosition
auxInitWindow

Are not recognized commands. Or something like that. And Yes, BTW I did not use only libopengl32.a I also used the AUX .a file. What next? Any other GL Libs that you would suggest? Thanks

BTW, To answer your question, I did get the .lib files elsewhere. Although I don’t recall where. Thanks…

The AUX library is out of date, use GLUT library instead.

Did you include the -lglaux in the linker command, that would case you to get an error on those commands?

But anyway the AUX library is out of date, use GLUT instead.

Originally posted by Me6:
BTW, To answer your question, I did get the .lib files elsewhere. Although I don’t recall where. Thanks…

These are my linker line commands:

-lopengl32 -lglaux

And I used those commands with the Opengl32.lib and glaux.lib files and got the same error as my first post.

Then I tryed it agian with the .a versions of opengl32 and glaux and got:

Undefined reference to ‘auxInitDisplayMode’
Undefined reference to ‘auxInitPosition’
Undefined reference to ‘auxInitWindow’
Undefined reference to ‘__gxx_personality_v0’

Can I use the AUX commands with glut?

Thanks…

I tried to compile my program with the mingw version of g++ and this is what I got:

C:\mingw\bin>g++.exe c:\Dev-Cpp\mainn.c -lopengl32 -lglaux
C:\DOCUME~1\Fred\LOCALS~1\Temp/ccyacaaa.o(.text+0x3c):mainn.c: undefined referen
ce to `auxInitDisplayMode'
C:\DOCUME~1\Fred\LOCALS~1\Temp/ccyacaaa.o(.text+0x52):mainn.c: undefined referen
ce to `auxInitPosition'
C:\DOCUME~1\Fred\LOCALS~1\Temp/ccyacaaa.o(.text+0x62):mainn.c: undefined referen
ce to `auxInitWindow'

C:\mingw\bin&gt;

So It did the same thing in g++. Do you think it is something wrong with my Libs? Thanks…

GCC:

C:\mingw\bin>gcc.exe c:\Dev-Cpp\mainn.c -lopengl32 -lglaux
C:\DOCUME~1\Fred\LOCALS~1\Temp/cc6hbaaa.o(.text+0x3c):mainn.c: undefined referen
ce to `auxInitDisplayMode'
C:\DOCUME~1\Fred\LOCALS~1\Temp/cc6hbaaa.o(.text+0x52):mainn.c: undefined referen
ce to `auxInitPosition'
C:\DOCUME~1\Fred\LOCALS~1\Temp/cc6hbaaa.o(.text+0x62):mainn.c: undefined referen
ce to `auxInitWindow'

C:\mingw\bin&gt;

MINGW32-C++:

C:\mingw\bin>"mingw32-c++.exe" c:\Dev-Cpp\mainn.c -lopengl32 -lglaux
C:\DOCUME~1\Fred\LOCALS~1\Temp/ccOobaaa.o(.text+0x3c):mainn.c: undefined referen
ce to `auxInitDisplayMode'
C:\DOCUME~1\Fred\LOCALS~1\Temp/ccOobaaa.o(.text+0x52):mainn.c: undefined referen
ce to `auxInitPosition'
C:\DOCUME~1\Fred\LOCALS~1\Temp/ccOobaaa.o(.text+0x62):mainn.c: undefined referen
ce to `auxInitWindow'

C:\mingw\bin&gt;

MINGW-G++:

C:\mingw\bin>"mingw32-g++.exe" c:\Dev-Cpp\mainn.c -lopengl32 -lglaux
C:\DOCUME~1\Fred\LOCALS~1\Temp/cc6Bbaaa.o(.text+0x3c):mainn.c: undefined referen
ce to `auxInitDisplayMode'
C:\DOCUME~1\Fred\LOCALS~1\Temp/cc6Bbaaa.o(.text+0x52):mainn.c: undefined referen
ce to `auxInitPosition'
C:\DOCUME~1\Fred\LOCALS~1\Temp/cc6Bbaaa.o(.text+0x62):mainn.c: undefined referen
ce to `auxInitWindow'

C:\mingw\bin&gt;

MINGW-GCC:

C:\mingw\bin>mingw32-gcc.exe c:\Dev-Cpp\mainn.c -lopengl32 -lglaux
C:\DOCUME~1\Fred\LOCALS~1\Temp/ccgHbaaa.o(.text+0x3c):mainn.c: undefined referen
ce to `auxInitDisplayMode'
C:\DOCUME~1\Fred\LOCALS~1\Temp/ccgHbaaa.o(.text+0x52):mainn.c: undefined referen
ce to `auxInitPosition'
C:\DOCUME~1\Fred\LOCALS~1\Temp/ccgHbaaa.o(.text+0x62):mainn.c: undefined referen
ce to `auxInitWindow'

C:\mingw\bin&gt;

Borland BCC32:

C:\Borland\BCC55\Bin>bcc32.exe c:\Dev-Cpp\mainn.c -lopengl32 -lglaux
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
c:\Dev-Cpp\mainn.c:
Error E2209 c:\Dev-Cpp\mainn.c 3: Unable to open include file 'windows.h'
Error E2209 c:\Dev-Cpp\mainn.c 4: Unable to open include file 'conio.h'
Error E2209 c:\Dev-Cpp\mainn.c 5: Unable to open include file 'gl\gl.h'
Error E2209 c:\Dev-Cpp\mainn.c 6: Unable to open include file 'gl\glaux.h'
Error E2451 c:\Dev-Cpp\mainn.c 10: Undefined symbol 'AUX_SINGLE' in function mai
n
Error E2451 c:\Dev-Cpp\mainn.c 10: Undefined symbol 'AUX_RGBA' in function main
Warning W8065 c:\Dev-Cpp\mainn.c 10: Call to function 'auxInitDisplayMode' with
no prototype in function main
Warning W8065 c:\Dev-Cpp\mainn.c 11: Call to function 'auxInitPosition' with no
prototype in function main
Warning W8065 c:\Dev-Cpp\mainn.c 12: Call to function 'auxInitWindow' with no pr
ototype in function main
Error E2451 c:\Dev-Cpp\mainn.c 15: Undefined symbol 'GL_COLOR_BUFFER_BIT' in fun
ction main
Warning W8065 c:\Dev-Cpp\mainn.c 15: Call to function 'glClear' with no prototyp
e in function main
Warning W8065 c:\Dev-Cpp\mainn.c 16: Call to function 'glFlush' with no prototyp
e in function main
Warning W8065 c:\Dev-Cpp\mainn.c 18: Call to function 'getch' with no prototype
in function main
Warning W8070 c:\Dev-Cpp\mainn.c 19: Function should return a value in function
main
*** 7 errors in Compile ***

C:\Borland\BCC55\Bin>

No you use GLUT in place of GL AUX, most websites have examples using GLUT. nehe.gamedev.net

I have not used the GL aux with DEV-C++, but I noticed that the glaux.h header is missing from the include directory. This could be your problem, do a google search for the glaux.h file and download it to the INCLUDE/GL directory.

Originally posted by Me6:
[b]These are my linker line commands:

-lopengl32 -lglaux

And I used those commands with the Opengl32.lib and glaux.lib files and got the same error as my first post.

Then I tryed it agian with the .a versions of opengl32 and glaux and got:

Undefined reference to ‘auxInitDisplayMode’
Undefined reference to ‘auxInitPosition’
Undefined reference to ‘auxInitWindow’
Undefined reference to ‘__gxx_personality_v0’

Can I use the AUX commands with glut?

Thanks…[/b]

Before I tried to compile for the first time I realized that the header file was missing and I retreived one. But I will try to get one from a more reliable source. Thanks…