delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/16/09:37:04

From: nostra AT city DOT ac DOT uk (Mark Lewis)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: simple c++, yet no compilation
Date: 16 May 1997 12:14:35 GMT
Organization: City University, London
Lines: 42
Message-ID: <5lhj3c$q6n@bambam.soi.city.ac.uk>
References: <MPG DOT de5a3d8f726b414989680 AT news DOT c3net DOT net>
NNTP-Posting-Host: swindon.city.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

-----BEGIN PGP SIGNED MESSAGE-----

On Thu, 15 May 1997 23:51:37 -0400, evarlast <jrwren AT oakland DOT edu> wrote:
> upon this:
> #include<iostream.h>
> void main(void)
> {
>  cout << "blah";
> };
> 
> I get this as a result. - my DJGPP.ENV is set fine.
> 
> P:\lbah>gcc blah.cpp
> P:/tmp\ccdaaaaa(.text+0x16):blah.cc: undefined reference to `cout'
> P:/tmp\ccdaaaaa(.text+0x1b):blah.cc: undefined reference to 
> `ostream::operator<<
> 
> (char const *)'

Try: gxx blah.cpp

This will link the required libraries automatically.  I guess your
semi-colon after the body of main() is a typo.

	Mark.

- -- 
________________________________________________________________
Mark Lewis - Software Engineer, City University, London, England
Email: M DOT Lewis AT city DOT ac DOT uk, nostra AT city DOT ac DOT uk (MIME,PGP)
WWW  : http://www.city.ac.uk/nostra/

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: noconv

iQCVAgUBM3xPwL+exwC8S2+xAQHCDgP/SBzCPfL+O3GAgucXvcEORpSvdCBSNVe2
/B2IPBSNj64hlcZOuFzA/lHAGtX/YfxAuYRrbXtFh0Ro9bNxgvuRFMJcSu4Bclzk
+TJnl0xYa4kYsEUKHMsnQQ6jgwjM8hBeAyHWLldjNiloUlHbUylmH9tE7b9oJ7GN
NIT5pxd40KU=
=dEt1
-----END PGP SIGNATURE-----

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019