Forum     

Go Back   Digit Technology Discussion Forum > Software > Open Source
Register FAQ Calendar Mark Forums Read

Open Source A place where you can talk to like-minded people about the fastest growing software movement today! Discuss anything and everything about Open Source software and Operating Systems.


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 05-03-2008, 10:01 AM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: Apr 2007
Location: Pune
Posts: 22
Default c under linux


hi friends,
My hard disk is burnt and i am using my pc on live linux cds with a pen dirve, to watch movies and for other tasks. I want to practice C on pc. Now I am using knoppix 5.1.1 and ubuntu 7.1 live bootable cds. Then how can i practice gcc compiler under this condition. I want details of running c under linux. I am using pen drive as storage device and live bootable linux cds. I am new linux user.
Please help me.
Please................
Thank YOu...
Ratnadeep is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 05-03-2008, 10:08 AM   #2 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: c under linux

Knoppix doesn't have gcc installed?
Or you might want to try something like sabayon.
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 05-03-2008, 10:16 AM   #3 (permalink)
In The Zone
 
::cyborg::'s Avatar
 
Join Date: Oct 2005
Location: NEW DELHI
Posts: 436
Default Re: c under linux

why dont u buy a new hdd it is cheaper these days

or if u hv usb u can get ur hands on win xp usb edition no need for an hdd
__________________
:)) - KEEP SMILING
::cyborg:: is offline  
Old 05-03-2008, 10:20 AM   #4 (permalink)
The Smaller Bang
 
MetalheadGautham's Avatar
 
Join Date: Sep 2007
Location: Gautham City
Posts: 7,489
Default Re: c under linux

^^sabayon is too heavy to be run live. I recomend he try installing knoppix on the pendrive.

and I think it already has GCC installed. Why not try typing GCC in the terminal and see if the program responds with the oh so boring <you need to choose the following options> <blah blah blah> message ?
__________________
http://TheSmallerBang.wordpress.com
eMachines E725 - T4400 2.2GHz, 1GB, 160GB
Nokia 5130XM * T-Sonic 610 2GB
Nokia 2323C * Samsung Galaxy Y
Apple iPad 2 16GB WiFi
MetalheadGautham is offline  
Old 05-03-2008, 11:15 AM   #5 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: c under linux

Quote:
Originally Posted by MetalheadGautham View Post
^^sabayon is too heavy to be run live. I recomend he try installing knoppix on the pendrive.
You ever used Sabayon? Do you know it comes with fluxbox?
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 05-03-2008, 11:30 AM   #6 (permalink)
left this forum longback
 
praka123's Avatar
 
Join Date: Sep 2005
Location: -
Posts: 7,536
Default Re: c under linux

@OP:utilize a pendrive for the time being(if u have) few distros can be booted from usb pendrive.
__________________
left this forum long back.Admin Can Delete this Account and posts Permanantly.Thank You
Get GNU/Linux - http://getgnulinux.org
praka123 is offline  
Old 05-03-2008, 05:19 PM   #7 (permalink)
Right Off the Assembly Line
 
Join Date: Apr 2007
Location: Pune
Posts: 22
Default Re: c under linux

Quote:
Originally Posted by ::cyborg:: View Post
why dont u buy a new hdd it is cheaper these days

or if u hv usb u can get ur hands on win xp usb edition no need for an hdd
i have spend lot more many on these instruments from ram to my mobile. so for at least a month there will not any money for hdd from home

what is win xp usb edition, is it installation of xp on usb, i tried that but it not worked. explain..
thanks for thread

Quote:
Originally Posted by MetalheadGautham View Post
^^
and I think it already has GCC installed. Why not try typing GCC in the terminal and see if the program responds with the oh so boring <you need to choose the following options> <blah blah blah> message ?
i tried gcc typing gcc in terminal but that not worked.
i am using knoppix 5.1.1

Quote:
Originally Posted by praka123 View Post
@OP:utilize a pendrive for the time being(if u have) few distros can be booted from usb pendrive.
how to do this
i have 2gb 2.0 pendrive
whatever i use it should run on it and should support for the using c in it
please help i am a new guy

hi
in case of hardware, i have it all.
1gb ram
core2duo processor
motherbord intel g965

but hard disk is burnt
have 2 gb pen drive
please friends help me.

Last edited by Ratnadeep; 05-03-2008 at 05:19 PM. Reason: Automerged Doublepost
Ratnadeep is offline  
Old 05-03-2008, 05:36 PM   #8 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: c under linux

On Ubuntu 7.10, launch it live and in case there is no gcc by default in it, issue the command:
Code:
sudo apt-get install build-essential
This should install the packages required for C, C++ and Fortran languages and Make, etc.
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 05-03-2008, 05:42 PM   #9 (permalink)
left this forum longback
 
praka123's Avatar
 
Join Date: Sep 2005
Location: -
Posts: 7,536
Default Re: c under linux

@ratandeep:
below link may help installing Ubuntu on usb.get build-essential installed later.
http://www.debuntu.org/how-to-instal...nux-on-usb-bar
__________________
left this forum long back.Admin Can Delete this Account and posts Permanantly.Thank You
Get GNU/Linux - http://getgnulinux.org
praka123 is offline  
Old 05-03-2008, 06:56 PM   #10 (permalink)
Console Junkie
 
aditya.shevade's Avatar
 
Join Date: Jun 2006
Location: USA
Posts: 991
Default Re: c under linux

Guys, I think he wants to know how to compile C/C++ programs in *nix.

If that is what you need. Then I think knoppix comes with gcc. So, you just write the program in any text editor. Save it wherever you want. Open the terminal. Go to the path where you saved the file. Then type
Code:
gcc <filename.c>
to compile it. Then use
Code:
./a.out
to run it.

Aditya
__________________
--- Console Junkie
aditya.shevade is online now  
Old 05-03-2008, 07:50 PM   #11 (permalink)
Resident Fanatic
 
Manshahia's Avatar
 
Join Date: Jul 2006
Location: /Milky way/earth/india/
Posts: 911
Default Re: c under linux

./a.out

what is "a" here..
or its just a command..?
not having linux installed at this particular time..
so just curious about it..

also one more thing i want to ask is that when we compile a program in windows say in TC, .exe file is created.
what happens in linux??
__________________
----------
Manshahia is offline  
Old 05-03-2008, 08:00 PM   #12 (permalink)
Google Bot
 
Pathik's Avatar
 
Join Date: Aug 2005
Posts: 9,772
Default Re: c under linux

a.out is the default (executable) output file name by gcc. and you execute it using ./
__________________
My new blog: www.pathikshah.com
Pathik is offline  
Old 05-03-2008, 08:13 PM   #13 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: c under linux

Quote:
Originally Posted by Manshahia View Post
./a.out

what is "a" here..
or its just a command..?
not having linux installed at this particular time..
so just curious about it..

also one more thing i want to ask is that when we compile a program in windows say in TC, .exe file is created.
what happens in linux??
Windows has a habit of making all executable files have a compulsory .exe to execute I suppose.

On Linux, any file with a +x permission is enough to be executed. Extension, name or any other property doesn't matter. (+r for readable, +w for writable and +x for executable, its as simple as this)

So a compiled file may be called XY, or XY..XZ or XX.YY.ZZ, it doesnt matter, it should have the +x permission set and it can be executed.
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 05-03-2008, 09:38 PM   #14 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: c under linux

Quote:
Originally Posted by Manshahia View Post
./a.out

what is "a" here..
or its just a command..?
assembler.output
I believe it's an elf binary though the name suggests otherwise. See http://en.wikipedia.org/wiki/A.out_(file_format)
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 12-03-2008, 07:25 PM   #15 (permalink)
Resident Fanatic
 
Manshahia's Avatar
 
Join Date: Jul 2006
Location: /Milky way/earth/india/
Posts: 911
Default Re: c under linux

so..
tried to compile my first program in Linux..
i want to knw that format of C/C++ remains same whether it is done in linux or windows..
second thing i made a simple program and when tried to compile using GCC it said cudnt find conio.h, iostream.h, blah blah blah....
__________________
----------
Manshahia is offline  
Old 12-03-2008, 07:35 PM   #16 (permalink)
Console Junkie
 
aditya.shevade's Avatar
 
Join Date: Jun 2006
Location: USA
Posts: 991
Default Re: c under linux

The syntax remains the same as long as you use standard C/C++ code and compilers.
__________________
--- Console Junkie
aditya.shevade is online now  
Old 12-03-2008, 07:40 PM   #17 (permalink)
Wahahaha~!
 
Faun's Avatar
 
Join Date: Dec 2006
Location: Pune/there
Posts: 7,676
Default Re: c under linux

Turbo C program needs some polishing before trying on ANSI C compliant GCC compiler

Read any ANSI C book and u will find urself right at home with GCC
__________________
Blog | Flickr | Battlelog
Spoiler:
Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX|D7000|XONAR STX|RE272|RE0|CC51|XE200PRO Walnut| TD II V2| Ultraphile|N5800

Mono
Faun is online now  
Old 12-03-2008, 07:47 PM   #18 (permalink)
Who stole my Alpaca!
 
FilledVoid's Avatar
 
Join Date: Jan 2005
Location: Kerala
Posts: 2,020
Default Re: c under linux

Quote:
i want to knw that format of C/C++ remains same whether it is done in linux or windows..
The Format / Syntax C/C++ doesn't change based on the Operating System you use but rather the Compiler you use.

Quote:
second thing i made a simple program and when tried to compile using GCC it said cudnt find conio.h, iostream.h, blah blah blah....
Because conio.h is not part of the C standard. I'm not sure about iostream though.
__________________
The Ultimate Chess Strategy : "Hit Hard, Hit Fast and Hit Often"
FilledVoid is offline  
Old 12-03-2008, 07:47 PM   #19 (permalink)
Console Junkie
 
aditya.shevade's Avatar
 
Join Date: Jun 2006
Location: USA
Posts: 991
Default Re: c under linux

^^ Isn't TurboC (Borland Compiler) compatible with ANSI C and GCC with ISO C/C++?

As far as I know, people use ISO standard these days....

@Manshahia, iostream.h is no longer iostream.h according to ISO standards (which are used by GCC, MingW32, etc) but it is plain iostream now. remove the .h extension.
__________________
--- Console Junkie
aditya.shevade is online now  
Old 13-03-2008, 02:30 AM   #20 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: c under linux

Btw,you shouldn't be using gcc for compiling a C++ program. Use g++ for that purpose, else it'll spew out some garbage.
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 13-03-2008, 07:18 AM   #21 (permalink)
Console Junkie
 
aditya.shevade's Avatar
 
Join Date: Jun 2006
Location: USA
Posts: 991
Default Re: c under linux

Isn't g++ part of GCC? (I read in the repository that the package name was gcc-g++-x.x.x.x)
__________________
--- Console Junkie
aditya.shevade is online now  
Old 13-03-2008, 09:20 AM   #22 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: c under linux

Well, what Harsh meant was gcc=GNU C Compiler
GCC=GNU Compiler Collection
There's a difference between gcc as a program and GCC suite of compilers.

Quote:
Originally Posted by Ratnadeep View Post
i tried gcc typing gcc in terminal but that not worked.
i am using knoppix 5.1.1
One more "did not work" person. Like we are GOD.
Can you please tell what did not work?
I hope you didn't expect a full blown IDE to pop up when you typed gcc at the command prompt.
__________________
http://www.bash.org/?258908

Last edited by mehulved; 13-03-2008 at 09:20 AM. Reason: Automerged Doublepost
mehulved is offline  
Old 25-03-2008, 12:07 PM   #23 (permalink)
Right Off the Assembly Line
 
Join Date: Apr 2007
Location: Pune
Posts: 22
Smile Re: c under linux

hello friends,

I am really thankful for your advice and i am now capable of compiling all my c programms in knoppix.
From last 4 moths i am using my pc without hard disk and with no problem or limitation in my work.
Thanks Knoppix.
Now, I am fan of KDE and I liked it most.

Again THANKS Friends.
Ratnadeep is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
BRAVO LINUX - US Army struggles with Windows to Linux overhaul techtronic Technology News 1 06-02-2008 06:59 AM
Experiance of a Linux user-what he learned from past 10 years using Linux praka123 Random News 83 04-02-2008 09:09 PM
Linutop Mini Linux PC Reviewed - Damn Small Linux Hardware ray|raven Open Source 7 14-12-2007 06:02 PM
MS Windows to Linux, Rise of Desktop Linux world!! mediator Technology News 87 24-09-2007 02:52 PM

 
Latest Threads
- by Charan
- by Charan
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 03:01 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2