DEVC++ and glut

Started by cpsmith0191, September 21, 2017, 22:29:59

Previous topic - Next topic

cpsmith0191

As a beginner moving on from text based C++ I found GLUT easier to understand than opengl and a good place to start for ' learn ye 2d graphics'.
One slight problem, can't get past '#include <GL/glut.h>' as attempts to compile produce an error at this point.
I used the 'package manager' from 'tools' to install the glut7.6-3.devpak.
I'm running DEVC++5.10 under windows10 and c:\dec-cpp\include\GL\glut.h exists.
I've tried various solutions as described on the web, including ensuring that the correct files are linked under project/parameters/library.
Any ideas appreciated as I'm new to devc++ and feel tempted by the dark side (going back to visualC++), have fun cps.

RonTek

Quote from: cpsmith0191 on September 21, 2017, 22:29:59
c:\dec-cpp\include\GL\glut.h exists.

Probably just some typo errors? c:\Dev-cpp\..?

Is this your first time using MinGW and IDEs?

cpsmith0191

#2
Thanks for the input. This is my second install (after uninstalling the first) and is in C:\Dev-Cpp\ the first was in C:\programm files(x86).
I've written (tweaked examples) using windows application, console application and openGL and all compile under this installation and under the previous installation. I've double checked and I run C:\Dev-Cpp\devcpp.exe to start the IDE.
I am an absolute beginner in C++ my only previous experience being under VisualC with a dabble in objectiveC with cocoa (mac).
Is your reply a hint? is  '-' an illegal character in a file spec? long time since I had to think of this sort of thing, have fun cps

RonTek

#3
Quote from: cpsmith0191 on September 21, 2017, 23:19:26
Thanks for the input. This is my second install (after uninstalling the first) and is in C:\Dev-Cpp\ the first was in C:\programm files(x86).
I've written (tweaked examples) using windows application, console application and openGL and all compile under this installation and under the previous installation. I've double checked and I run C:\Dev-Cpp\devcpp.exe to start the IDE.
I am an absolute beginner in C++ my only previous experience being under VisualC with a dabble in objectiveC with cocoa (mac).
Is your reply a hint? is  '-' an illegal character in a file spec? long time since I had to think of this sort of thing, have fun cps

Sure thing and I see. I do suggest using CodeBlocks instead for IDE as I'm assuming that you will be relying on 3rd party libraries (SDL2, OpenAL, etc) eventually or probably sharing your work at some point and creating a build system for your projects. Most open source projects use CMake (or premake) for their build and I don't think there's enough support for Dev-Cpp as a dev environment.

Going back to your problem, I think this is just Dev-Cpp not seeing the include directories, same setup with Visual Studio.

RonTek

#4
Quote from: cpsmith0191 on September 21, 2017, 23:19:26
Is your reply a hint? is  '-' an illegal character in a file spec? long time since I had to think of this sort of thing, have fun cps

The '-' character is fine. Actually, I have Dev-Cpp MinGW64 version (OrwellDevCpp) installed (C:\Program Files (x86)\Dev-Cpp) as well and have used it on older projects, but haven't used it for a long time.  ;)

cpsmith0191

#5
As I'm just starting with C++ I'll side step the problem for now, by taking your advice and using a different/better supported IDE.
I will at some point have a look at how the DEVC IDE identifies the include directory so thanks for the suggestion.
So back to installing an IDE and matching it to a third party graphics library. I seem to remember running into a similar problem with Borland C that put me right off C.
Last time I jumped ship and ran with Blitz Max, hopefully I'll stay the course this time. Many thanks for your input, have fun cps.

dawlane

#6
I didn't think that DevC++ was still around. If I remember it was written in Delphi 6. As for CodeBlocks, it's OK, but code completion has been known to have issues.
As for issues with not finding files, check that the required directories are set in your project and compiler options.
Another IDE is CodeLite

Just installed DevC++ and it's buggy. Tried creating glut project and it failed to set anything up.
Edit:
QuoteJust installed DevC++ and it's buggy.
It's incredibly buggy and many of the packages are not complete.

cpsmith0191

#7
Of course I couldn't resist fiddling and I've tried using the DEVC++ environment options to manually add search directories for include and lib. This cured the original hang point  ('couldn't find glut.h')  but then another hang point occurred near the end of the compilation.
So now I'm going to try out some of the suggested IDE's. Yes I really am.. no I'm not going to have one more go at getting the glut libs recognised.  The future is bright and the future is C++ ( but not DevC++). Once again many thanks, have fun cps
PS Gone with codeblocks, installed glut, fiddled with settings (#include windows.h in basic framework) all fine... Thanks!

EdzUp

Dont use Dev C++ if your serious about using C++ I would get Code::Blocks and use that it has a handy basic OpenGL template that would set it up for your input. If your hellbent on using GLUT (which is deprecated now) look at FreeGLUT which is more up to date and has loads of tutorials and examples.

sphinx

Quote from: EdzUp on September 24, 2017, 13:05:24
Dont use Dev C++ if your serious about using C++ I would get Code::Blocks and use that it has a handy basic OpenGL template that would set it up for your input. If your hellbent on using GLUT (which is deprecated now) look at FreeGLUT which is more up to date and has loads of tutorials and examples.
EdzUp, Dev C++ is one of the first C++ IDE you used to use.
I remember you mentioned that at the old Blitz forums if I am not mistaken!
It is outdated and I second your opinion.
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com

cpsmith0191

Reasons for using DEVC++: It meets ISO standard for C++ and it came free with a book I've got ' beginng C++ game programing' (dated 2004). Reasons for using GLUT: I'd prodded it a little previously and its easy to follow the syntax ( I'm sure I saw ref to it in 'blitz max' source code but I may be dreaming).
So many traps for the novice, so much goes out of date so fast. I'll take note and have a look at the openGL template in code blocks. You never know I may actually produce something other than chunks of C++ that do the maths equivalent of 'Hello World'.
Thanks for all input, have fun cps.

RonTek

Quote from: cpsmith0191 on September 24, 2017, 21:07:47
Reasons for using DEVC++: It meets ISO standard for C++ and it came free with a book I've got ' beginng C++ game programing' (dated 2004). Reasons for using GLUT: I'd prodded it a little previously and its easy to follow the syntax ( I'm sure I saw ref to it in 'blitz max' source code but I may be dreaming).
So many traps for the novice, so much goes out of date so fast. I'll take note and have a look at the openGL template in code blocks. You never know I may actually produce something other than chunks of C++ that do the maths equivalent of 'Hello World'.
Thanks for all input, have fun cps.

Here's a curated list that can get you started, which seems popular on GitHub, so you don't stumble into outdated C++ stuff again.  ;D

The only funny thing is Dev C++ is still listed there, but I think that's for posterity reason and it's the Orwell version that I have and pointed out earlier.

QuoteA curated list of awesome C/C++ frameworks, libraries, resources, and shiny things. Inspired by awesome-... stuff.

https://github.com/fffaraz/awesome-cpp

cpsmith0191

Awesome.. well named. I'll try to resist it while I hone my skills, but I can feel Nivarna tugging. Thanks for the pointers, have fun cps

RonTek

Quote from: cpsmith0191 on September 25, 2017, 20:16:10
Awesome.. well named. I'll try to resist it while I hone my skills, but I can feel Nivarna tugging. Thanks for the pointers, have fun cps

Sure thing and glad this helped somehow. :)