www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/08/04/03:21:19

Xref: news-dnh.mv.net comp.os.msdos.djgpp:1351
Newsgroups: comp.os.msdos.djgpp
Path: news-dnh.mv.net!mv!news.sprintlink.net!howland.reston.ans.net!EU.net!uknet!newsfeed.ed.ac.uk!hwcee!pjbk
From: pjbk AT cee DOT hw DOT ac DOT uk (Peter JB King)
Subject: What have I done wrong with g++
Sender: news AT cee DOT hw DOT ac DOT uk (News Administrator)
Organization: Dept of Computing & Electrical Engineering, Heriot-Watt
University, Scotland
Date: Thu, 3 Aug 1995 15:26:07 GMT
Lines: 48
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

I have installed djgpp 1.12m4 (and am an experienced C programmer using
it).
I decided to try out C++, since we are going to be using it to teach
students next year.  I seem to have immediate problems as soon as I use
manipulators in the output stream.  I would have thought that I have
done something gross as pat of the installation, but I can't think what!
Could some kind reader enlighten me?

The failing program and teh compiler output when using gcc -v is appended.

// failure of setw in the output stream
#include <iostream.h>
#include <iomanip.h>

main()
{
  int j = 735;
  cout << j << setw(4) <<j <<endl;
}


Output from
	gcc -v fail.cc -o fail -lgpp

gcc version 2.6.0
 c:/gcc/bin/cpp.exe -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=6 -Dunix -Di386 -DGO32 -DMSDOS -D__unix__ -D__i386__ -D__GO32__ -D__MSDOS__ -D__unix -D__i386 -D__GO32 -D__MSDOS -Asystem(unix) -Asystem(msdos) -Acpu(i386) -Amachine(i386) t1.cc c:/gcc/tmp/cc020392
GNU CPP version 2.6.0 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 c:/gcc/cplusinc
 c:/gcc/include
 /usr/local/lib/g++-include
 /usr/local/include
 /usr/local/go32/include
 /usr/local/lib/gcc-lib/go32/2.6.0/include
 /usr/include
End of search list.
 c:/gcc/bin/cc1plus.exe c:/gcc/tmp/cc020392 -quiet -dumpbase t1.cc -version -o c:/gcc/tmp/cca20392
GNU C++ version 2.6.0 (80386, BSD syntax) compiled by GNU C version 2.6.0.
t1.cc: In function `int main()':
t1.cc:22: warning: assignment to `int' from `float'
 c:/gcc/bin/as.exe -o c:/gcc/tmp/ccb20392 c:/gcc/tmp/cca20392
 c:/gcc/bin/ld.exe -o t1 c:/gcc/lib/crt0.o -Lc:/gcc/lib c:/gcc/tmp/ccb20392 -lgpp -lgcc -lc -lgcc
t1.cc(.text+0x11d): undefined reference to `operator<<(ostream &, smanip<int> const &)'
-- 
Peter King, Computing & Electrical Eng.	 Internet: pjbk AT cee DOT hw DOT ac DOT uk
  Heriot-Watt University, Riccarton, Edinburgh EH14 4AS
Phone: (+44) 131 451 3433               Fax: (+44) 131 451 3431

- Raw text -


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