delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/04/30/10:14:53

Via: uk.ac.sheffield-hallam; Sat, 30 Apr 1994 14:21:25 +0100
From: A DOT K DOT Heath AT sheffield-hallam DOT ac DOT uk (Andy Heath)
To: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)
Subject: small problem
Date: Sat, 30 Apr 94 13:56
Sender: A DOT K DOT Heath AT sheffield-hallam DOT ac DOT uk

Hello, please can anybody help with this obviously trivial thing ?

I'm using 2.5.7 with MSDOS on pc and having been using it to compile C 
for ages with no troubles I'm just starting to try and compile C++.  I'm 
having trouble with getting anything which uses cin or cout to load.  
I've tried
                      gcc myprog.cc
and
                     gcc -lgpp myprog.cc
with minimal programs but cout is always undefined.  Can anybody easily 
tell me what's wrong ?
Below is an attempt with -lgpp (which it finds) and a prog.   I'm not on 
the list so if it's not too much trouble  please could you reply to this 
address.

Thankyou very much for your time. 

Andy Heath
THE OUTPUT
----------------------
gcc -v -lgpp akh.cc
Reading specs from c:\djgpp/lib/specs
gcc version 2.5.7
 c:\djgpp/bin/cpp.exe -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 
-D__cplusplus -D__GNUC_MINOR__=5 -Dunix -Di386 -DGO32 -DMSDOS -D__unix__ 
-D__i386__ -D__GO32__ -D__MSDOS__ -D__unix -D__i386 -D__GO32 -D__MSDOS 
akh.cc C:/TEMP/cc015485
GNU CPP version 2.5.7 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 c:\djgpp/cplusinc
 c:\djgpp/include
 /usr/local/lib/g++-include
 /usr/local/include
 /usr/local/go32/include
 /usr/local/lib/gcc-lib/go32/2.5.7/include
 /usr/include
End of search list.
 c:\djgpp/bin/cc1plus.exe C:/TEMP/cc015485 -fno-builtin -quiet -dumpbase 
akh.cc -version -o C:/TEMP/cca15485
GNU C++ version 2.5.7 (80386, BSD syntax) compiled by GNU C version 
2.5.7.
 c:\djgpp/bin/as.exe -o C:/TEMP/ccb15485 C:/TEMP/cca15485
 c:\djgpp/bin/ld.exe c:\djgpp/lib/crt0.o -Lc:\djgpp/lib -lgpp 
C:/TEMP/ccb15485 -lgcc -lc -lgcc
akh.cc(.text+16): undefined reference to `cout'
akh.cc(.text+1b): undefined reference to `ostream::operator<<(const char 
*)' 

THE PROG
-----------------
#include <iostream.h>

int main()
{ cout << "silly\n" ; }


BTW: somebody mentioned 2.5.8.   Should I be using it ? Where can I get 
it from ?



- Raw text -


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