From owner-freebsd-questions Fri Jul 9 10:29:13 1999 Delivered-To: freebsd-questions@freebsd.org Received: from sand4.global.net.uk (sand4.global.net.uk [194.126.80.248]) by hub.freebsd.org (Postfix) with ESMTP id 7ACE514D0D for ; Fri, 9 Jul 1999 10:29:09 -0700 (PDT) (envelope-from marko@globalnet.co.uk) Received: from p7as11a06.client.global.net.uk ([195.147.219.123] helo=marder-1.) by sand4.global.net.uk with esmtp (Exim 2.12 #1) id 112eSR-00073l-00; Fri, 9 Jul 1999 18:29:07 +0100 Received: (from marko@localhost) by marder-1. (8.9.2/8.8.8) id SAA00343; Fri, 9 Jul 1999 18:16:50 +0100 (BST) (envelope-from marko) Date: Fri, 9 Jul 1999 18:16:50 +0100 From: Mark Ovens To: "Mikhail V. Evstiounin" Cc: Rezamys , freebsd-questions@FreeBSD.ORG Subject: Re: newbie: how to compile & run C program in 3.2Release? Message-ID: <19990709181649.A263@marder-1> References: <003601beca04$87ad15e0$6f27abcd@mvehpc.evs.slip.lm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: <003601beca04$87ad15e0$6f27abcd@mvehpc.evs.slip.lm.com>; from Mikhail V. Evstiounin on Fri, Jul 09, 1999 at 08:13:58AM -0400 Organization: Total lack of Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Jul 09, 1999 at 08:13:58AM -0400, Mikhail V. Evstiounin wrote: > Hi! > > > My company is using gcc on HP-UX 10.20 and 11.0. I installed > all versions of gcc starting from 2.5 on all our machines - HP > boxes, IBM RS 6000 boxes, Sequent Boxes. As a result I am trying to > follow any news in gcc world. > > There is a difference between 2.7.1.1 and 2.8.1 in terms of C++ > (I believe, since version 2, gcc and g++ were combined as one > compiler g++). Correct, however there are still 2 binaries: marder-1:/usr/marko{57}% ls -l `which gcc g++` -r-xr-xr-x 3 root wheel 4720 Feb 15 10:42 /usr/bin/g++ -r-xr-xr-x 2 root wheel 49544 Feb 15 10:42 /usr/bin/gcc Which one you use determines some compiler defaults. From the manpage: The C and C++ compilers are integrated. Both process input files through one or more of four stages: prepro- cessing, compilation, assembly, and linking. Source file- name suffixes identify the source language, but which name you use for the compiler governs default assumptions: gcc assumes preprocessed (.i) files are C and assumes C style linking. g++ assumes preprocessed (.i) files are C++ and assumes C++ style linking. > 2.8.1 works with templates much closer to C++ standard v.3.0, but > still doesn't have namespaces, correct exceptions and something else. And egcs works even better with templates. However, as the original poster is at the "Hello, World" stage I don't think that they would gain any benefit from using 2.8.1 over the default. > According to docs, gcc 2.8.1 does a little better job in terms of > optimizations. > It can affect you if you use -O3 parameter. > > -----Original Message----- > From: Mark Ovens > To: Rezamys > Cc: freebsd-questions@FreeBSD.ORG > Date: Thursday, July 08, 1999 3:09 PM > Subject: Re: newbie: how to compile & run C program in 3.2Release? > > > >On Thu, Jul 08, 1999 at 11:33:07AM +0800, Rezamys wrote: > >> Hi Mark, > >> Okay, tried it last nite. It was fine. Thanks! > >> I did this (very simple program...): > >> > >> #include > > > [skipped] > > >I'm not sure what you're asking here. cc *is* a GNU compiler. If > >you mean will gcc work, then yes, but you're already using it. The > >default version with FreeBSD is 2.7.2.1, this is the only one > >verified to build kernels. You can install gcc-2.8.1 (which you > >use as gcc -o hello hello.c). This won't overwrite the default so > >you will have 2 versions. > > > >I doubt, however, that you will need anymore than the default. > > > >OK, you done "Hello, World". Now get yourself a copy of Kernighan & > >Ritchie (2nd edition), and carry on ;-). > > > >> > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > -- FreeBSD - The Power To Serve http://www.freebsd.org My Webpage http://www.users.globalnet.co.uk/~markov _______________________________________________________________ Mark Ovens, CNC Apps Engineer, Radan Computational Ltd. Bath UK CAD/CAM solutions for Sheetmetal Working Industry mailto:markov@globalnet.co.uk http://www.radan.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message