LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-21-2008, 11:04 AM   #1
Ace Blackwell
Member
 
Registered: Mar 2004
Location: Kentucky, USA
Distribution: SlamD 12.1 / Slack 12.0 ~ 14.2_64
Posts: 307

Rep: Reputation: 41
New Project in gcc


I'm sure this question has been answered a blue million times but I can't find anything on it.

How can I start a new C project in gcc (KDE GUI) and not have to decide if its a "Hello World" or a "Linux Kernal" program? Or am I supposed to use one of these two.

I'm trying to complie a program I downloaded (fwcutter) but I don't know the command line compiling commands so i opted for the KDE developing package but it won't let me create (or I don't know how to) create a blank project to be populated as I add files.

Any help would be greatly appreciated, or if there is an easier way to compile the fwcutter.c program please let me know.

thanks in advance,

Ace

Last edited by Ace Blackwell; 03-21-2008 at 11:05 AM.
 
Old 03-21-2008, 11:47 AM   #2
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 59
Well if you want to start a new C project just create the source file, open it with an editor and start coding.

I am just learning C myself, what I have done is make a directory called programming in a terminal window I'll cd to that dir. and create the file like so touch filename.c just make sure you use the .c extension then open the file with what ever editor you use.

You don't have to create the file in the manner I do, from within the directory you can create it when you open your editor lets say you use emacs (nice editor by the way) from within the directory type emacs -rv filename.c and when emacs starts it will create the file upon saving it. Oh the -rv stands for reverse video emacs will open with a black background so it's a little easier on the eyes.

You can create the file with just about any editor the same way.

Note: emacs has a setting in options that you can highlight your code with colors, nano can be edited to do the same but takes a little work, also if you install the full vi editors add-ons it will have colored code.

Quote:
Any help would be greatly appreciated, or if there is an easier way to compile the fwcutter.c program please let me know.
From within the dir. that you downloaded fwcutter.c to compile it with the gcc compiler type

gcc -o fwcutter fwcutter.c

This will compile the source and create an executable called fwcutter. Unless you have errors in which case you will need to edit your source to fix them.

To learn what the gcc options are type gcc --help

Edit: I should add, to run the executable file prefix the file with ./ so it would be ./filename so in your case you would execute the file like so, ./fwcutter

Last edited by mrrangerman; 03-21-2008 at 11:54 AM. Reason: add info
 
Old 03-21-2008, 06:00 PM   #3
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
A Linux kernel program is a linux kernel module, a hello world program is a program that says "Hello World". What I usually do in Kdevelop is use the hello world program and just delete the src files that are premade
 
Old 03-21-2008, 09:53 PM   #4
Ace Blackwell
Member
 
Registered: Mar 2004
Location: Kentucky, USA
Distribution: SlamD 12.1 / Slack 12.0 ~ 14.2_64
Posts: 307

Original Poster
Rep: Reputation: 41
Thanks

I appreciate the help. I did use the gcc command to compile. However I was curious about the KDE Developer. And that answered my question. Just delete the body and accompaning files. I just didn't know if it would work with mutiple files. While I haven't compiled for Linux, I do have experience with Quick C for DOS. The differnce there was the editor came up with as a blank. You had to add the files, and create the make file.

Thanks again. I'll work on this and see if I can get my Wireless to work. I'm getting tired of going to Linux to try something and then reboot back to Windows to access the net. LOL.

Ace
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Print.Print Add to Project.Add to Project Bookmark with del.icio.us Simplify PHP Development with WASP LXer Syndicated Linux News 0 01-21-2006 09:46 PM
gcc wont install, 'failed dependencies: glibc-devel is needed by gcc-3.3.3-41' TdlSnare SUSE / openSUSE 3 11-29-2004 03:13 PM
Beginning a big project - Need an Good Project Manager gamehack Programming 3 01-15-2004 12:49 PM
Compile Visual C++ project using gcc on Linux jdmc020 Programming 4 11-04-2003 01:43 PM
Cannot see Open GL project in KDevelop project wizard SparceMatrix Programming 2 08-08-2002 12:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration