From owner-freebsd-questions@FreeBSD.ORG Tue Jun 7 19:01:03 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 EBC3C16A41C for ; Tue, 7 Jun 2005 19:01:02 +0000 (GMT) (envelope-from keyser456@verizon.net) Received: from vms042pub.verizon.net (vms042pub.verizon.net [206.46.252.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id B2FB143D1F for ; Tue, 7 Jun 2005 19:01:02 +0000 (GMT) (envelope-from keyser456@verizon.net) Received: from mdis ([66.14.40.249]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IHQ00KLGA5PG615@vms042.mailsrvcs.net> for freebsd-questions@freebsd.org; Tue, 07 Jun 2005 14:01:02 -0500 (CDT) Date: Tue, 07 Jun 2005 12:01:41 -0700 From: "Keyser" To: Message-id: <000601c56b93$578c8a80$5b01a8c0@mdis> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-Priority: 3 X-MSMail-priority: Normal Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Problem w/ simple Hello World compiled w/ g++ X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2005 19:01:03 -0000 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 = simple c++ "Hello World" program to run (it compiles fine) under = FreeBSD. Here's the source: //helloworld.cpp #include using namespace std; int main() { cout << "Hello world!" << endl; return 0; } I use g++ and it compiles fine, but I get an error immediately after = running the program: # 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) 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 = related 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?