Skip to main content
GameDev.net gamedev.net
🔒 Locked

Lesson 1 compiling problems

Started by cs_vipa Jul 14, 2003 at 7:33 AM 2 replies 600+ views
Original Post
cs_vipa
cs_vipa
Hi, Ive been trying to compile lesson1 using g++ in cygwin. cygwin g++ does not provide glaux.h in its opengl distribution so ive taken the borland glaux and stuck it in my cywin include files. The nehe source code gives three errors when i compile linking the libraries glu32 and opengl32 Undefined reference to ChoosePixelFormat Undefined reference to SetPixelFormat Undefined reference to SwapBuffers Are these methods part of the glaux library? Thanks, Vipa
JuNC
JuNC
No, they''re part of GDI (gdi32.dll/lib).
Jon Brooks
Jon Brooks
You don''t seem to be using the Cygwin code for lesson 1 (which doesn''t use glaux.h) - also the Cygwin code is in C not C++ so you should be using gcc instead of g++ to compile.

Also I''m reasonably sure that it is not enough to simply get the glaux header files. You also need the Borland def and lib files, then to create a lib file for Cygwin. This is a bit involved and I tried it after I got Undefined reference errors when compiling the first lesson, before realising that I needed to link to the gl libraries in the compile command, so I never completed the process of generating a Cygwin lib file.
I did find a couple of web pages that described how to do this but unfortunately can''t find them now. If you do a search you should eventually find something.
I am also intending to convert the Cygwin lesson codes to C++ and would be happy to collaborate with you if you like.
cs_vipa
cs_vipa
Hi,
I was actually trying to compile NeHe''s VC++ code for lesson 1 using cygwin. Ive managed to get it to compile now using:

g++ lesson01.cpp -lopengl32 -lglu32 -lgdi32

The reason I was using the VC++ code rather than the cygwin C code provided is because nehe''s C++ code had extra testing methods and added functionality that I wanted to understand for use in another project.

Nehe''s VC++ code for the later lessons where he loads in bmps doesnt work in cygwin because of the lack of glaux so I''ve used the cygwin examples bmp loading methods but kept all the rest of NeHe''s code.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.