 |
05-03-2008, 10:01 AM
|
#1 (permalink)
|
|
Right Off the Assembly Line
Join Date: Apr 2007
Location: Pune
Posts: 22
|
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...
|
|
|
|
Advertisements. Register and be a member of the community to get rid of them.
|
|
Advertisement
|
|
05-03-2008, 10:08 AM
|
#2 (permalink)
|
|
18 Till I Die............
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
|
Re: c under linux
Knoppix doesn't have gcc installed?
Or you might want to try something like sabayon.
__________________
http://www.bash.org/?258908
|
|
|
05-03-2008, 10:16 AM
|
#3 (permalink)
|
|
In The Zone
Join Date: Oct 2005
Location: NEW DELHI
Posts: 436
|
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
|
|
|
05-03-2008, 10:20 AM
|
#4 (permalink)
|
|
The Smaller Bang
Join Date: Sep 2007
Location: Gautham City
Posts: 7,489
|
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
|
|
|
05-03-2008, 11:15 AM
|
#5 (permalink)
|
|
18 Till I Die............
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
|
Re: c under linux
Quote:
Originally Posted by MetalheadGautham
^^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
|
|
|
05-03-2008, 11:30 AM
|
#6 (permalink)
|
|
left this forum longback
Join Date: Sep 2005
Location: -
Posts: 7,536
|
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
|
|
|
05-03-2008, 05:19 PM
|
#7 (permalink)
|
|
Right Off the Assembly Line
Join Date: Apr 2007
Location: Pune
Posts: 22
|
Re: c under linux
Quote:
Originally Posted by ::cyborg::
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
^^
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
@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
|
|
|
05-03-2008, 05:36 PM
|
#8 (permalink)
|
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,658
|
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
|
|
|
05-03-2008, 05:42 PM
|
#9 (permalink)
|
|
left this forum longback
Join Date: Sep 2005
Location: -
Posts: 7,536
|
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
|
|
|
05-03-2008, 06:56 PM
|
#10 (permalink)
|
|
Console Junkie
Join Date: Jun 2006
Location: USA
Posts: 991
|
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
to compile it. Then use
to run it.
Aditya
__________________
--- Console Junkie
|
|
|
05-03-2008, 07:50 PM
|
#11 (permalink)
|
|
Resident Fanatic
Join Date: Jul 2006
Location: /Milky way/earth/india/
Posts: 911
|
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??
__________________
----------
|
|
|
05-03-2008, 08:00 PM
|
#12 (permalink)
|
|
Google Bot
Join Date: Aug 2005
Posts: 9,772
|
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
|
|
|
05-03-2008, 08:13 PM
|
#13 (permalink)
|
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,658
|
Re: c under linux
Quote:
Originally Posted by Manshahia
./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
|
|
|
05-03-2008, 09:38 PM
|
#14 (permalink)
|
|
18 Till I Die............
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
|
Re: c under linux
Quote:
Originally Posted by Manshahia
./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
|
|
|
12-03-2008, 07:25 PM
|
#15 (permalink)
|
|
Resident Fanatic
Join Date: Jul 2006
Location: /Milky way/earth/india/
Posts: 911
|
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....
__________________
----------
|
|
|
12-03-2008, 07:35 PM
|
#16 (permalink)
|
|
Console Junkie
Join Date: Jun 2006
Location: USA
Posts: 991
|
Re: c under linux
The syntax remains the same as long as you use standard C/C++ code and compilers.
__________________
--- Console Junkie
|
|
|
12-03-2008, 07:40 PM
|
#17 (permalink)
|
|
Wahahaha~!
Join Date: Dec 2006
Location: Pune/there
Posts: 7,676
|
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
|
|
|
12-03-2008, 07:47 PM
|
#18 (permalink)
|
|
Who stole my Alpaca!
Join Date: Jan 2005
Location: Kerala
Posts: 2,020
|
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"
|
|
|
12-03-2008, 07:47 PM
|
#19 (permalink)
|
|
Console Junkie
Join Date: Jun 2006
Location: USA
Posts: 991
|
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
|
|
|
13-03-2008, 02:30 AM
|
#20 (permalink)
|
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,658
|
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
|
|
|
13-03-2008, 07:18 AM
|
#21 (permalink)
|
|
Console Junkie
Join Date: Jun 2006
Location: USA
Posts: 991
|
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
|
|
|
13-03-2008, 09:20 AM
|
#22 (permalink)
|
|
18 Till I Die............
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
|
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
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
|
|
|
25-03-2008, 12:07 PM
|
#23 (permalink)
|
|
Right Off the Assembly Line
Join Date: Apr 2007
Location: Pune
Posts: 22
|
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.
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|