From owner-freebsd-questions@FreeBSD.ORG Fri Dec 16 15:09:04 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 D3C9F16A41F for ; Fri, 16 Dec 2005 15:09:04 +0000 (GMT) (envelope-from davmiao@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1051B43D5A for ; Fri, 16 Dec 2005 15:09:03 +0000 (GMT) (envelope-from davmiao@gmail.com) Received: by wproxy.gmail.com with SMTP id i14so907085wra for ; Fri, 16 Dec 2005 07:09:03 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=W02oxH55sVPA6bXbpO9AHpoURDeLlY4Y3aF5BbSZSymlQIw1mYnWj9Iz1H73yvoEubzXnid/ySZ3ZvbTRB+1rwnlAGHUKWLqzmIEjy7qeDKtBE3+jT+T6w39+B8032EsxDEhwjQ5TMmWjuirHcbYMKcebhK12dBA39J0s6InRKc= Received: by 10.65.152.8 with SMTP id e8mr229476qbo; Fri, 16 Dec 2005 07:09:02 -0800 (PST) Received: by 10.65.51.14 with HTTP; Fri, 16 Dec 2005 07:09:02 -0800 (PST) Message-ID: <979f20140512160709n3530c01dmdad5714f8e30bc00@mail.gmail.com> Date: Fri, 16 Dec 2005 23:09:02 +0800 From: David Miao To: "freebsd-questions@freebsd.org" MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: C++ compile error 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: Fri, 16 Dec 2005 15:09:04 -0000 Dear list, I try to compile a hello world C++ program in FreeBSD 6.0, but get an error as below: [dm@ORION ~/cpp]% CC -o hello hello.C hello.C: In function `int main()': hello.C:5: error: `cout' undeclared (first use this function) hello.C:5: error: (Each undeclared identifier is reported only once for each function it appears in.) hello.C:5: error: `endl' undeclared (first use this function) I noticed that "iostream" file is located in "/usr/include/c++/3.4/iostream", I guess my CC compiler cannot find this head file. Is it true? And how can I fix this problem? Your advice is appreciated. Thanks in advance. =3D=3Dquote of hello world code=3D=3D #include int main() { cout << "Hello World!" << endl; return 0; } =3D=3D end of quote=3D=3D Regards, David