delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/02/08:15:54

From: Jos van Riswick <josvanr AT mbfys DOT kun DOT nl>
Date: Sun, 2 Nov 1997 14:12:04 +0100
Message-Id: <199711021312.OAA15278@vitellius.mbfys.kun.nl>
To: djgpp AT delorie DOT com

Hello, 

      I'm learning c++, and I'm using djgpp and bcc. The first
      program I wrote, called test.cc reads:

#include <iostream.h>

void main() {

	cout << "Hallo";

}

      It compiles fine with bcc. However, gcc, no. It doesn't 
      compile. When I type at the command prompt:


redir -o stdout -e stderr gcc -v test.cc -o test.exe

   
      I get the stderr:


Reading specs from c:/djgpp/lib\specs
gcc version 2.7.2.1
 c:/djgpp/bin\cpp.exe -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=7 -Dunix -Di386 -DGO32 -DMSDOS -DDJGPP=2 -DDJGPP_MINOR=1 -D__unix__ -D__i386__ -D__GO32__ -D__MSDOS__ -D__DJGPP__=2 -D__DJGPP_MINOR__=1 -D__unix -D__i386 -D__GO32 -D__MSDOS -D__DJGPP=2 -D__DJGPP_MINOR=1 test.cc c:/djgpp/tmp\ccbaaaaa
GNU CPP version 2.7.2.1 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 c:/djgpp/lang/cxx
 c:/djgpp/include
 c:/djgpp/contrib/grx20/include
 /usr/local/lib/g++-include
 /usr/local/include
 /usr/local/go32/include
 /usr/local/lib/gcc-lib/go32/2.7.2.1/include
 /usr/include
End of search list.
 c:/djgpp/bin\cc1plus.exe c:/djgpp/tmp\ccbaaaaa -quiet -dumpbase test.cc -version -o c:/djgpp/tmp\cccaaaaa
GNU C++ version 2.7.2.1 (80386, BSD syntax) compiled by GNU C version 2.7.2.1.
 c:/djgpp/bin\as.exe -o c:/djgpp/tmp\ccdaaaaa c:/djgpp/tmp\cccaaaaa
 c:/djgpp/bin\ld.exe -o test.exe c:/djgpp/lib\crt0.o -Lc:/djgpp/lib c:/djgpp/tmp\ccdaaaaa -Tdjgpp.djl -lgcc -lc -lgcc
c:/djgpp/tmp\ccdaaaaa(.text+0x16):test.cc: undefined reference to `cout'
c:/djgpp/tmp\ccdaaaaa(.text+0x1b):test.cc: undefined reference to `ostream::operator<<(char const *)'


      I don't understand the last errormessages "undefined ref.
      to 'cout'"??? This is c++ isn't it? Other c++
      constructions like:  for ( int a=1; a<2; a++ ) etc. work
      fine. I tried already using #include <stream.h> in stead
      of iostream.h. Anybody know what I do wrong???

      I include some stuff here: my autoexec.bat:


C:\WIN95\net start

  @ECHO OFF
  PROMPT $p$g
  SET MFJOBOPT=/3

  PATH C:\WIN95;C:\WIN95\COMMAND;C:\DOS;
  SET PATH=e:\UTIL\COMPRI;e:\UTIL\NORTON;d:\VIRUS\MAC;%PATH%
  SET PATH=e:\EMX\BIN;e:\EMTEX\BIN;e:\MYTEX;e:\EMTEX\LATEXCAD;%PATH%
  SET PATH=f:\BP\BIN;c:\anarkey;e:\bc\bin;e:\dbos;f:\vim;%PATH%

  SET DJGPP=C:\DJGPP\DJGPP.ENV
  SET PATH=C:\DJGPP\BIN;c:\djgpp\gnu\emacs\bin;%PATH%
  SET MGUIDIR=e:\MGUI\SYS

  SET EMTEXDIR=e:\EMTEX
  SET TMP=e:\TMP

  SET TEMP=C:\DOS

  SET DVIDRVFONTS=e:\TEXFONTS


  c:\prog\pcfont30\newfont c:\prog\pcfont30\josfont.fnt

  ncc c:\josdos/setall

path D:\perl\bin;%PATH%


      My config.sys:



DEVICE=C:\WIN95\SETVER.EXE
DEVICE=C:\WIN95\HIMEM.SYS
DOS=HIGH
FILES=50
BUFFERS=30
SHELL=C:\WIN95\COMMAND.COM C:\WIN95 /E:1024 /P
DEVICEHIGH/L:0=C:\WIN95\COMMAND\DRVSPACE.SYS /MOVE


      My enviroment variables:



winbootdir=C:\WIN95
COMSPEC=C:\WIN95\COMMAND.COM
windir=C:\WIN95
BLASTER=A220 I5 D1 H5
PROMPT=$p$g
MFJOBOPT=/3
DJGPP=C:\DJGPP\DJGPP.ENV
MGUIDIR=e:\MGUI\SYS
EMTEXDIR=e:\EMTEX
TMP=e:\TMP
TEMP=C:\DOS
DVIDRVFONTS=e:\TEXFONTS
PATH=D:\PERL\BIN;C:\DJGPP\BIN;C:\DJGPP\GNU\EMACS\BIN;F:\BP\BIN;C:\ANARKEY;E:\BC\BIN;E:\DBOS;F:\VIM;E:\EMX\BIN;E:\EMTEX\BIN;E:\MYTEX;E:\EMTEX\LATEXCAD;E:\UTIL\COMPRI;E:\UTIL\NORTON;D:\VIRUS\MAC;C:\WIN95;C:\WIN95\COMMAND;C:\DOS;
VIM=F:\VIM-4.6p\doc
CMDLINE=F:\VIM-4.6p\VIM stderr   


      The output of go32-v2:



go32/v2 version 2.0 built Aug 12 1996 22:27:23
Usage: go32 coff-image [args]
Rename this to go32.exe only if you need a go32 that can run v2 binaries as
 well as v1 binaries (old makefiles).  Put ahead of the old go32 in your PATH
 but do not delete your old go32 - leave it in the PATH after this one.
Set GO32_V2_DEBUG=y in the environment to get verbose output.

DPMI memory available: 9011 Kb
DPMI swap space available: 4453 Kb



      Hope somebody can help me...., please mail.


      Jos van Riswick

      josvanr AT mbfys DOT kun DOT nl

- Raw text -


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