From owner-freebsd-questions@FreeBSD.ORG Tue Jun 7 19:12:10 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D1A9716A41C for ; Tue, 7 Jun 2005 19:12:10 +0000 (GMT) (envelope-from dmitry.mityugov@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.195]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6F7AC43D1F for ; Tue, 7 Jun 2005 19:12:10 +0000 (GMT) (envelope-from dmitry.mityugov@gmail.com) Received: by wproxy.gmail.com with SMTP id 69so407472wri for ; Tue, 07 Jun 2005 12:12:09 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=DYwitPcQvpt4eTB07r9ayqdykonQgkCzPYKp2ta0lJL1MVe9CSjSuqNFfm8DzBemMp8v8MN6jsG8tu3tenALOcmUGoyvk2eIwuXU8l6lBYVSqRycXnMVVzPal0Urc7uE9bDzIRD2UlhPwWxR03VwEoDwm4k87nCyvWMcRdopxSo= Received: by 10.54.45.7 with SMTP id s7mr3661298wrs; Tue, 07 Jun 2005 12:12:09 -0700 (PDT) Received: by 10.54.56.33 with HTTP; Tue, 7 Jun 2005 12:12:09 -0700 (PDT) Message-ID: Date: Tue, 7 Jun 2005 23:12:09 +0400 From: Dmitry Mityugov To: Keyser In-Reply-To: <000601c56b93$578c8a80$5b01a8c0@mdis> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <000601c56b93$578c8a80$5b01a8c0@mdis> Cc: freebsd-questions@freebsd.org Subject: Re: Problem w/ simple Hello World compiled w/ g++ X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dmitry Mityugov List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2005 19:12:10 -0000 On 6/7/05, Keyser wrote: > I know quite a bit about programming, but not a lot about FreeBSD. I've = been pulling my hair out all morning just trying to get an unbelievably sim= ple c++ "Hello World" program to run (it compiles fine) under FreeBSD. Her= e's the source: >=20 > //helloworld.cpp > #include > using namespace std; >=20 > int main() > { > cout << "Hello world!" << endl; > return 0; > } >=20 > I use g++ and it compiles fine, but I get an error immediately after runn= ing the program: >=20 > # g++ -v > Using built-in specs. > Configured with: FreeBSD/i386 system compiler > Thread model: posix > gcc version 3.4.2 [FreeBSD] 20040728 > # ls > helloworld.cpp > # g++ -o helloworld helloworld.cpp > # ls > helloworld helloworld.cpp > # ./helloworld > Segmentation fault (core dumped) >=20 > Do I have missing or out of date libraries (not sure how that's possible = since I'm using the > latest version of FreeBSD, 5.4) or something and how = do I remedy that situation? Also, I > haven't "added" anything else relate= d to development yet, and wouldn't expect I'd have to > just to get a Hello= World program to run properly, but maybe I'm wrong? Cannot reproduce. Your program runs fine on my FreeBSD 5.4 machine. What directory are you compiling and running the program from? --=20 Dmitry "We live less by imagination than despite it" - Rockwell Kent, "N by E"