Advertisement

NeHe tutorials and devc++

Started by May 30, 2002 06:03 AM
11 comments, last by Lode 22 years, 8 months ago
Please help me, I''d like to be able to use the NeHe tutorials with devc++. I know VC++ exists and I know it''s better, but I''m not going to buy it. I don''t even manage to compile tutorial #1 under devc++! I did everything I read in old posts, and I still get linker errors. Some day I''m gonna @|#*!§ this linker! I added in the code: #ifndef CDS_FULLSCREEN #define CDS_FULLSCREEN 4 #endif And I added in Further object files: -lopengl32 -lglu32 -lglaux And acording to older posts supposed to work then, but I STILL get 3 linker errors! d:\programmeren\devcpp4\myprojects\ogltest\ogltest\main.o(.text+0x854):main.cpp: undefined reference to `ChoosePixelFormat@8'' d:\programmeren\devcpp4\myprojects\ogltest\ogltest\main.o(.text+0x898):main.cpp: undefined reference to `SetPixelFormat@12'' d:\programmeren\devcpp4\myprojects\ogltest\ogltest\main.o(.text+0xc2f):main.cpp: undefined reference to `SwapBuffers@4'' So that''s ChoosePixelFormat@8, SetPixelFormat@12 and SwapBuffers@4. Am I the only one getting this? I''m using Devc++ 4.
looks pretty much like you didn''t use a Win32 project. You must build it as Win32 App(not Console)
Advertisement
I just want to add that yesterday I also tried to get those Nehe´s first tutorial with Dev-C++ and i got the same errors than Lode...
Did you also:
#include <gl/gl.h>

?
That is strange. That shouldn''t happen. I have the same setup and it works fine. I did a search on MSDN and found that these are the required files:

Header: Declared in wingdi.h.
Import Library: Use gdi32.lib.

Your problem may be that you didn''t create the project correctly. When you are doing the tutorial, do you create a new project? if so, do you create an OpenGL or Windows project?

I choose the OpenGL template. I think this automatically includes those files above.

Also you can open your project file in a text editor(the .dev file) and see if it is set up correctly. Here is mine:
[Project]FileName=Lesson6.devName=Lesson6Type=0Ver=1ObjFiles=Includes=Libs=Resources=Compiler=Linker=-lopengl32 -lglu32 -lglauxIsCpp=1Icon=UnitCount=1[Unit1]FileName=Lesson6.cppOpen=1Top=1[Views]ProjectView=1


---
Make it work.
Make it fast.

"Commmmpuuuuterrrr.." --Scotty Star Trek IV:The Voyage Home
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]
quote:
Original post by t0bi
looks pretty much like you didn't use a Win32 project. You must build it as Win32 App(not Console)


Heh, that's it! I just turned on "Do not create a console" and it works.

Thanks.

BTW I had started with an "Empty project", I hadn't even seen the opengl temlate yet, good to know it exists!



[edited by - Lode on May 30, 2002 8:52:45 AM]
Advertisement
I am appraently missing something here.
What''s the distiction between VC++ and devc++ ?
To me, Microsoft Developer''s Studio is just an environment, it''s not a language. However, I know in practice people see the developer''s studio as one product with many components (including VB, SourceSafe et al) , and they often use VC++ and MSDEV interchangibly.

Is devc++ refering to the student edition of Developer Studio?

Never speak in absolutes.
-me
Never speak in absolutes. -me
quote:
Original post by Eric_Conspiracy
I am appraently missing something here.
What''s the distiction between VC++ and devc++ ?

Is devc++ refering to the student edition of Developer Studio?

Never speak in absolutes.
-me


Yeah, you are missing something. DevC++ is a free compiler.
A search in google reports the first hit as:

http://www.bloodshed.net/devcpp.html

quote:
To me, Microsoft Developer''s Studio is just an environment, it''s not a language.


MS Dev Studio is an enviroment, that includes Visual C++, that is a compiler of the C++ language.

quote:

However, I know in practice people see the developer''s studio as one product with many components (including VB, SourceSafe et al) , and they often use VC++ and MSDEV interchangibly.



Yes, DevStudio is a product with many components but from my knowledge, is not possible to buy VC++ without MSDEV, so that''s why people use their names interchangibly.
Sweet, this topic helped clear up my problems. Dev C++ is awesome! It''s amazing how a program like this can still be free.

Also, has anyone noticed the difference in file sizes between VC++ 4.0 and Dev-C++ 4.0? With VC++, the code from lesson 1 compiled into a 97 KB executable file, while Dev-C++ compiled the same code into an 8 KB file!
Yup, none is better or worse, they're just different, its just a matter of learning how to use em.
now regarding size it is true Mingw makes smaller executables if you compile "right out of the box" on both, but if you tweak the compiler options a little you will get smaller exes from MSVC, compiling on debug mode (the default on msvc) always generates bigger exes, this is true for Mingw too, but you have to turn on debugging mode with the -g flag.

I advocate and use Mingw for my personal projects.



[edited by - kwizatz on June 3, 2002 11:15:43 AM]

This topic is closed to new replies.

Advertisement