Something to program with....

Questions about applications and software
Forum rules
Before you post please read this

Something to program with....

Postby tupadjia on Fri Jun 15, 2007 12:46 am

Hi people,

I am fairly new to Linux Mint and as a intermediate programmer in Windows environment, I thought I'd try the same thing on Linux since my new job runs EVERYTHING on linux. What I am getting at is that I am basically looking for a program and a compiler so I can continue programming in C/C++. I did hear that those 2 languages are supported on Linux...I hope...
If anyone can direct me to where I can turn to find my own answers from now on, that'd be awesome...like I mentioned, I am fairly new to Linux.
Thanks guys!
tupadjia
Level 1
Level 1
 
Posts: 5
Joined: Fri Jun 15, 2007 12:42 am

Linux Mint is funded by ads and donations.
 

Postby flashmann on Fri Jun 15, 2007 3:06 am

I think, it should be possible with NetBeans IDE (Linux version)
http://www.netbeans.info/downloads/start.php?f_id=20158&lang_id=1
plus C/C++ pack
http://www.netbeans.info/downloads/start.php?f_id=20253&lang_id=1

I haven't tried it yet myself, but it looks promising.
flashmann
Level 1
Level 1
 
Posts: 6
Joined: Sat Feb 10, 2007 6:47 am

Postby scorp123 on Fri Jun 15, 2007 3:17 am

On Linux the C compiler most people use is gcc ... I suggest you read a book about it.

Other stuff you might want to look at:
http://linuxmafia.com/faq/Devtools/ides.html
http://www.eclipse.org/
http://anjuta.sourceforge.net/
http://www.kdevelop.org/
User avatar
scorp123
Level 8
Level 8
 
Posts: 2287
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Re: Something to program with....

Postby scorp123 on Fri Jun 15, 2007 3:23 am

tupadjia wrote:... so I can continue programming in C/C++. I did hear that those 2 languages are supported on Linux...I hope...
BTW, the Linux kernel is written in C :wink:

:lol:
User avatar
scorp123
Level 8
Level 8
 
Posts: 2287
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Postby gcc on Fri Jun 15, 2007 12:37 pm

I am a programmer on Linux and find C/C++ support to be very much more complete on Linux than on Windows, but the development tools are pretty different. Usually I use Kate for my text editor, g++ for my C++ compiler, and gdb for my debugger. Not sure if you care, but gdb also has support for frame substitution, which (IMHO) is probably the best feature on any debugger anywhere. I personally prefer the CLI, but if GUI is more your thing there are about a bajillion frontends to GDB, of which nemiver seems to be the prettiest.
I would also read up on autoconf and automake.
To get you up and running, heres the rundown on compiling, debugging, and running a small bit of code.

Code: Select all
#include <iostream>
using namespace std;

int main(void) {
     for (int i=0; i < 5; i++) {
           cout << "We meet again!" << endl;
     }
     return 0;
}


save it as "sillyPirate.cpp".
to compile this simply type:

Code: Select all
g++ sillyPirate.cpp


which will create an executable in your current working directory named a.out. you can change that behavior by specifying the -o option for g++.
To debug it, you will need debugging symbols- which you will get like so:

Code: Select all
g++ -g sillyPirate.cpp


then run it through gdb:

Code: Select all
gdb ./a.out


this will bring you to the gdb prompt. to begin debugging, type "run", which will attempt to run all the way through the program and will give you information about its termination. setting a breakpoint is accomplished by typing "break", followed by a valid symbol or line number. stepping can be done by using the "s" and "n" commands, killing a process is done with "kill", and exiting is done with "exit". There are literally hundreds of more advanced features in GDB, and thousands in GCC, but for now that should suffice to get you started. if you have any problems, let me know.
gcc
Level 1
Level 1
 
Posts: 40
Joined: Thu Jun 14, 2007 9:45 pm


Return to Software & Applications

Who is online

Users browsing this forum: rsully49 and 19 guests