From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32651 invoked by alias); 29 Jun 2002 01:47:22 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 32464 invoked from network); 29 Jun 2002 01:47:20 -0000 Received: from unknown (HELO smtp08.eresmas.com) (62.81.160.128) by sources.redhat.com with SMTP; 29 Jun 2002 01:47:20 -0000 Received: from [172.20.126.176] (helo=smtp01.eresmas.com) by smtp08.eresmas.com with esmtp id 17O7KZ-0000bP-00 ; Sat, 29 Jun 2002 03:47:19 +0200 Received: from [62.83.49.20] (helo=K7) by smtp01.eresmas.com with esmtp id 17O7KY-0005W2-00; Sat, 29 Jun 2002 03:47:19 +0200 To: faisal gillani Cc: gcc-help@gcc.gnu.org Subject: Re: newbie of c++ in linux References: <20020629011550.68843.qmail@web11003.mail.yahoo.com> Reply-To: gcc-help@gcc.gnu.org From: Oscar Fuentes Date: Fri, 28 Jun 2002 18:47:00 -0000 In-Reply-To: <20020629011550.68843.qmail@web11003.mail.yahoo.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-06/txt/msg00253.txt.bz2 faisal gillani 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 > #include > void main (void) > { > printf("hello world"); > } #include int main() { printf("hello wordl\n"); } contains a typo 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