What Is The Best Option If You're New To Programming And


bustaballs

Member
Joined
Dec 31, 2007
Messages
196
What is the best option if you're new to programming and want to start c++ programming on Linux? I've been studying c++ basics and using the bloodshed dev-c++ IDE in Windows but when I use the same basic "Hello World" style codes in popular Linux IDEs, they won't compile. All of the books and documentation related to Linux programming assumes you already have plenty of programming experience.

My goal is to program not specifically for Windows but to learn to program for all sorts of OSs and devices and that's where I want to start. Does anyone have any suggestions?
 

lulzfish

Pandora Defense Squad
Joined
Jan 14, 2009
Messages
3,503
Website
troyanonymous.homelinux.com
I just use the command-line.
Get your favorite text editor (gedit is good), type up your programs, then run

`g++ -o executable_name source_code_name.cpp`
(make sure you've used `cd` to get to the directory of the code first)

and then it should compile if you have all the libraries installed right.
You can also try Code::Blocks, but I find it crashes too much.

What are you using, Ubuntu?
 

WizardStan

Mega GP Mania
Joined
May 24, 2008
Messages
16,733
If building your own Makefiles or compiling from command line do not appeal to you at all, I recommend KDevelop. It feels very similar to Dev-C++ in Windows, and handles creating the Makefile and all that for you. I've created a few fairly large projects with it.
Eventually you'll want to learn how to build your own Makefile, or at least download a standard one and understand how it works.
 

dflemstr

It's a ball.
Joined
Jul 31, 2008
Messages
2,514
Location
Stockholm, Sweden
Website
Visit site
If you want an easy development process, just use Qt Creator. It's an IDE that supports almost anything you can throw at it.
Screenshot:
29lmteo.png


With it, you can either develop drag-and-drop GUI Qt applications, animated QML-based user experiences, or just any other C++ or C app you want.
It supports the following build systems:
  • qmake
  • CMake
  • Make
  • SCons
  • ...probably more but I haven't tried any others

...and it supports integration with the following version control systems:
  • Git
  • SVN
  • Mercurial
  • Perforce
  • CVS

I mean srsly, what else would you ever need...
 

Ravnos

Asleep in Samsara
Joined
Sep 20, 2005
Messages
2,499
Age
40
Location
Edmonton, Alberta
Website
Visit site
dflemstr said:
If you want an easy development process, just use Qt Creator. It's an IDE that supports almost anything you can throw at it.
Screenshot: (REMOVED)

With it, you can either develop drag-and-drop GUI Qt applications, animated QML-based user experiences, or just any other C++ or C app you want.
It supports the following build systems:
  • qmake
  • CMake
  • Make
  • SCons
  • ...probably more but I haven't tried any others

...and it supports integration with the following version control systems:
  • Git
  • SVN
  • Mercurial
  • Perforce
  • CVS

I mean srsly, what else would you ever need...

I was under the impression that QT Creator was heavily geared towards QT development, especially Symbian/Maemo. How does it compare to the various alternatives for stuff like SDL, OpenGL, or even GTK+ development?
 
Last edited by a moderator:

dflemstr

It's a ball.
Joined
Jul 31, 2008
Messages
2,514
Location
Stockholm, Sweden
Website
Visit site
Ravnos said:
I was under the impression that QT Creator was heavily geared towards QT development, especially Symbian/Maemo. How does it compare to the various alternatives for stuff like SDL, OpenGL, or even GTK+ development?
Well I wouldn't say that. It's more like a full-fledged C++ IDE that can do cross-compilation, with some Qt-specific features tacked on.

For SDL/GL stuff, you do:
Code:
#include <SDL/SDL.h>
#include <GL/gl.h>

...and add these lines to your .pro file (if you use qmake for your build system):
Code:
QT -= core gui #To remove Qt features from your project
LIBS += -lGL -lSDL #To link additional libs

If you use a different build system you'd do it differently of course. It's not difficult at all... I'm currently writing a project that uses OpenSceneGraph and Bullet via CMake and it integrates fine with QtCreator...
 
Last edited by a moderator:

bustaballs

Member
Joined
Dec 31, 2007
Messages
196
Thanks for all of the tips everyone. I'll check out that IDE and attempt to use the CLI compiler soon.
 

bustaballs

Member
Joined
Dec 31, 2007
Messages
196
Quick question: The Allegro library is cross-platform but if I code games with it, would I be able to easily port them to hand held systems like the Pandora, GP2X, Dingoo, PSP, etc?

(I'm working my way though "Beginning C++ Through Game Programming Second Edition" and I hope that gives me enough knowledge to begin programming visual games at that point.)
 

lulzfish

Pandora Defense Squad
Joined
Jan 14, 2009
Messages
3,503
Website
troyanonymous.homelinux.com
bustaballs said:
Quick question: The Allegro library is cross-platform but if I code games with it, would I be able to easily port them to hand held systems like the Pandora, GP2X, Dingoo, PSP, etc?

(I'm working my way though "Beginning C++ Through Game Programming Second Edition" and I hope that gives me enough knowledge to begin programming visual games at that point.)
I think Allegro is going to work on the Pandora, and I've heard it can just act as a wrapper for SDL (Which is fantastic, you should try it), and it probably has been ported to GP2X and Dingoo as well, but since the PSP is a piece of crap, I can't say.

Allegro's site says it will run on Windows, Mac, Unix, etc., but since the PSP isn't running a Linux kernel, it would be a lot of effort to port it, and I don't think anyone has.
 
Last edited by a moderator:

bustaballs

Member
Joined
Dec 31, 2007
Messages
196
I'm still very new to c++ but from what you're saying, I assume I'd just include the ported version of the library with the game and it should run with minor adjustments like GUI/Resolution and redo the code for file i/o based on the specific device?
 

WizardStan

Mega GP Mania
Joined
May 24, 2008
Messages
16,733
bustaballs said:
I'm still very new to c++ but from what you're saying, I assume I'd just include the ported version of the library with the game and it should run with minor adjustments like GUI/Resolution and redo the code for file i/o based on the specific device?
That is the idea, just change the library and compiler to the ARM versions and hit "build" and it'll give you an ARM executable vs an x86 one, give or take a few modifications.
But I also seem to be recalling something about Allegro being difficult to port to Linux, so I'm not certain if it would work. My memory is very fuzzy on the subject, since it was before pre-orders were taken for the Pandora that the discussion occurred. It was one of the reasons Adventure Game Studio was so hard to port to Linux. I don't know if it still applies, but you should definitely investigate it carefully before making any final decisions.
 
Last edited by a moderator:

bustaballs

Member
Joined
Dec 31, 2007
Messages
196
Ok. I spoke with some people over at the allegro forums and they say that there's a port of the library for the ipod touch/iphone and for the gp2x. Do you think there will be enough support to make a port for the pandora or dingoo?
 
Top