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: NNTP-Posting-Host: swindon.city.ac.uk To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk -----BEGIN PGP SIGNED MESSAGE----- On Thu, 15 May 1997 23:51:37 -0400, evarlast wrote: > upon this: > #include > 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-----