public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* newbie of c++ in linux
@ 2002-06-28 18:15 faisal gillani
  2002-06-28 18:47 ` Oscar Fuentes
  0 siblings, 1 reply; 2+ messages in thread
From: faisal gillani @ 2002-06-28 18:15 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 751 bytes --]

Well i am a newbie learning c++ these days we are
being thaught on turbo c 3.0 but as like other things
i want to work on c++ in linux .. so i installed gcc
on my linux box but i dont have any idea how to
install it for example i write a program as follows in
turbo c

#include<studio.h>
#include<conio.h>
void main (void)
{
printf("hello world");
}



how do i write the same program in gcc ?
i have tried the same but it gives out error the
#in... files not found 
what can i do & how to compile this program ?

thanks
faisal

=====
*º¤., ¸¸,.¤º*¨¨¨*¤ Allah-hu-Akber*º¤., ¸¸,.¤º*¨¨*¤

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: newbie of c++ in linux
  2002-06-28 18:15 newbie of c++ in linux faisal gillani
@ 2002-06-28 18:47 ` Oscar Fuentes
  0 siblings, 0 replies; 2+ messages in thread
From: Oscar Fuentes @ 2002-06-28 18:47 UTC (permalink / raw)
  To: faisal gillani; +Cc: gcc-help

faisal gillani <fasi_74@yahoo.com> writes:

> Well i am a newbie learning c++ these days we are
> being thaught on turbo c 3.0 but as like other things
> i want to work on c++ in linux .. so i installed gcc
> on my linux box but i dont have any idea how to
> install it for example i write a program as follows in
> turbo c
> 
> #include<studio.h>
> #include<conio.h>
> void main (void)
> {
> printf("hello world");
> }

#include <stdio.h>

int main() {
  printf("hello wordl\n");
}

<stdudio.h> contains a typo

<conio.h> does not exists on Linux. It is not a C or C++ Standard
header file. Furthermore, I doubt that it is necessary at all for
building that program with your Windows compiler.

And now build the program with

g++ myprogram.cpp -o myprogram

Note that you should use 'g++' instead of 'gcc' for building C++
apps. g++ automatically uses some libraries that are often required
for building C++ apps.

It will generate an executable called "myprogram". If "-o myprogram"
were absent it will generate an executable named 'a.out'. It's a valid
executable, despite it's name. Execute your program with

./myprogram

note the ./ It's necessary because, out of the box, most shells does
not looks for executables on the current directory, so you need to say
"execute the 'myprogram' executable which is located on the current
directory"

 
> 
> 
> how do i write the same program in gcc ?
> i have tried the same but it gives out error the
> #in... files not found 
> what can i do & how to compile this program ?

Hope this helps.

Now execute the command 

info g++

and enjoy the fine manual :-)

-- 
Oscar

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-06-29  1:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-28 18:15 newbie of c++ in linux faisal gillani
2002-06-28 18:47 ` Oscar Fuentes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).