Jump to content

  • Log In with Google      Sign In   
  • Create Account

CodeWarrior Pro 6 and OpenGL


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 JeroMiya   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 August 2001 - 10:46 AM

I stil can''t get CodeWarrior to compile an OpenGL program. When I create a new OpenGL program and go to "Add Files" to add the OpenGL libraries GLAUX.LIB, GLU32.LIB, and OPENGL32.LIB and then try to include from these libraries with: #include // Header File For The OpenGL32 Library #include // Header File For The GLu32 Library #include // Header File For The Glaux Library it gives me these errors: Error : the file ''GL/gl.h'' cannot be opened GLU.H line 22 #include Error : the file ''GL/gl.h'' cannot be opened GLAUX.H line 57 #include Error : the file ''GL/glu.h'' cannot be opened GLAUX.H line 58 #include There are those header files in the Win32 support folder in the headers folder. Also, when I try using #include #include #include What''s going on? why does my new project with the opengl libraries added not compile?

Sponsor:

#2 JeroMiya   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 August 2001 - 05:47 PM

I found the solution. I''ll post it here for others who had my same problem.
This goes for most recent versions of codewarrior.
Step 1) Download the Win32 glut libraries, they are available at http://www.xmission.com/~nate/glut.html
Step 2) place a copy of glut.h into CodeWarrior/Win32-x86 Support/Headers/Win32 SDK/gl/
Step 3) Place a copy of glut32.lib in CodeWarrior/Win32-x86 Support/Libraries/Win32 SDK/
For a glut application:
Step 4) Create a new project in codeWarrior
Step 5) Select Win32 C++ console application and create the project
Step 6) Go to add files, and select glut32.lib that you just copied to your codewarrior folder.
For a non-glut application:
Step 4) Create a new project in codeWarrior
Step 5) Select Win32 GUI and create a project
---- then for both types
Step 6/7) Add glu32.lib, opengl32.lib, and maybe glaux.lib if you want to use glaux to your project.
Step 8) Copy glut32.dll into your project folder, not your project in codewarrior, just into the same folder as your executable will be
Step 9) Add your glut code to the project, remove the placeholder source file (hello32.cp or something similar)
Step 10) change your includes from to , (CodeWarrior automatically searches the entire Win32 SDK headers file for headers, you don''t need to specify that it''s in the gl folder when you compile with codewarrior. If you want portable code, then do something like:

#define COMPILE_FOR_CODEWARRIOR
// #define COMPILE_FOR_GCC


#ifndef COMPILE_FOR_GCC
#include gl/glut.h
...
#endif
#ifndef COMPILE_FOR_CODEWARRIOR
#include glut.h
...
#endif

Dont know if that actually works, but something like that.


#3 NextS   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 August 2001 - 10:31 AM

There''s an alternative.
The behaviour of automatic recursive search of includes only works when the files are not prefixed with "somepath/to/include/glut.h". If a path like this one occurs in your sourcecode then you need to add the directory before the somepath directory to your include pathes.

In your case you need to add the path "CodeWarrior/Win32-x86 Support/Headers/Win32 SDK" to your acces pathes in the project preferences. This should do the trick

NextS




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS