🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50354

Having a problem using gcc with the -x c++ option

#50354
From: David A. Baldwin
Date: Mon, 11 Oct 1993 20:09
26 lines
1536 bytes
I have a c++ program which is simply a hello world program in the 
fact that it simply includes stdio.h and stream.h, then it has a 
cout << "Hello World\n";  This works when I compile it with g++, 
but not when I compile it with gcc.

The program is called main.cc
and I compiled it with gcc -x c++ main.cc.  That to me seems pretty
normal.  I get a link error that says.

ld:
Undefined:
cout
__ls__7ostreamPCc
collect: /usr/bin/ld returned 1 exit status

I would appreciate anyone that could give me any help.
I just cannot seem to figure it out, the man pages seem to 
indicate that that is  the way to do it.

Thank you very much,
daveyb@is-next.umd.edu
-- 
*********************************************************************
( David Baldwin  A Proud Member of the Technical Consulting Staff   )
(                at University of Maryland at College Park          )
(       							    )
Technical Details
Message-ID: <29cegt$s6u@umd5.umd.edu>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!haven.umd.edu!umd5.umd.edu!cygnus.umd.edu!daveyb

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,d3ed36563be88685,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-10-11 14:08:55 PST
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!haven.umd.edu!umd5.umd.edu!cygnus.umd.edu!daveyb
From: daveyb@cygnus.umd.edu (David A. Baldwin)
Newsgroups: gnu.gcc.help
Subject: Having a problem using gcc with the -x c++ option
Date: 11 Oct 1993 20:09:01 GMT
Organization: University Of Maryland, College Park, MD
Lines: 26
Message-ID: <29cegt$s6u@umd5.umd.edu>
NNTP-Posting-Host: cygnus.umd.edu