www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/26/16:31:52

From: paulj63110 AT my-dejanews DOT com
Newsgroups: comp.os.msdos.djgpp
Subject: Help please
Date: Mon, 26 Apr 1999 20:01:33 GMT
Organization: Deja News - The Leader in Internet Discussion
Lines: 102
Message-ID: <7g2gmq$15s$1@nnrp1.dejanews.com>
NNTP-Posting-Host: 209.135.140.175
X-Article-Creation-Date: Mon Apr 26 19:49:54 1999 GMT
X-Http-User-Agent: Mozilla/4.5 [en] (Win98; U)
X-Http-Proxy: 1.0 x15.dejanews.com:80 (Squid/1.1.22) for client 209.135.140.175
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

When I try to complie the following program I get error messages the
following output. The program is an example from a book so it should work, I
am wondering if it is a bug in the compiler. Does anybody have and
suggestions???


program:

#include <iostream.h>
#include <conio.h>

class stack
{
 public:
 static int stack_count ;
 public:

        static int get_count(void)
        {
            return(stack_count);
        }
        stack()
        {
          ++stack_count;
        }
};

main()
{
 stack a_stack;
 stack b_stack;
 stack c_stack;


 clrscr();


 cout << stack::get_count;
}


output: D:\programs>gxx -o  141a.exe 141a.cc -v Reading specs from
d:/djgpp/lib/gcc-lib/djgpp/2.81/specs gcc version 2.8.1 
d:/djgpp/lib/gcc-lib/djgpp/2.81/cpp.exe -lang-c++ -v -undef -D__GNUC__=2
-D__GN UG__=2 -D__cplusplus -D__GNUC_MINOR__=8 -Dunix -Di386 -DGO32 -DMSDOS
-DDJGPP=2 - DDJGPP_MINOR=1 -D__unix__ -D__i386__ -D__GO32__ -D__MSDOS__
-D__DJGPP__=2 -D__DJ GPP_MINOR__=1 -D__unix -D__i386 -D__GO32 -D__MSDOS
-D__DJGPP=2 -D__DJGPP_MINOR=1  -D__EXCEPTIONS 141a.cc
d:/djgpp/tmp/RH3caaaa\ccaqx2eh GNU CPP version 2.8.1 (80386, BSD syntax)
#include "..." search starts here: #include <...> search starts here: 
d:/djgpp/lang/cxx  d:/djgpp/include  d:/djgpp/lang/cxx 
d:/djgpp/lib/gcc-lib/djgpp/2.81/include  d:/djgpp/include End of search list.
 d:/djgpp/lib/gcc-lib/djgpp/2.81/cc1plus.exe d:/djgpp/tmp/RH3caaaa\ccaqx2eh
-qui et -dumpbase 141a.cc -version -o d:/djgpp/tmp/RH3caaaa\ccbqx2eh GNU C++
version 2.8.1 (djgpp) compiled by GNU C version 2.8.1.	d:/djgpp/bin/as.exe
-o d:/djgpp/tmp/RH3caaaa\cccqx2eh d:/djgpp/tmp/RH3caaaa\ccb qx2eh 
d:/djgpp/bin/ld.exe -o 141a.exe d:/djgpp/lib/gcc-lib/djgpp/2.81/crtf.o
d:/djgpp /lib/crt0.o -Ld:/djgpp/lib/gcc-lib/djgpp/2.81 -Ld:/djgpp/bin
-Ld:/djgpp/lib d:/d jgpp/tmp/RH3caaaa\cccqx2eh -lstdcxx -lm -lgcc -lc -lgcc
-Tdjgpp.djl d:/djgpp/tmp/RH3caaaa\cccqx2eh(.text+0x5d):141a.cc: undefined
reference to `stac k::stack_count'
d:/djgpp/tmp/RH3caaaa\cccqx2eh(.text+0x71):141a.cc: undefined reference to
`stac k::stack_count'

output of go32/v2
go32/v2 version 2.0 built Nov 15 1998 14:36:43
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: 50865 Kb
DPMI swap space available: 25571 Kb

environ.lst
TMP=C:\WINDOWS\TEMP
TEMP=C:\WINDOWS\TEMP
PROMPT=$p$g
winbootdir=C:\WINDOWS
COMSPEC=C:\WINDOWS\COMMAND.COM
PATH=D:\DJGPP\BIN;C:\WINDOWS;C:\WINDOWS\COMMAND
DJGPP=D:\DJGPP\DJGPP.ENV
windir=C:\WINDOWS
BLASTER=A220 I5 D1 T4
DJDIR=d:/djgpp
USER=dosuser
GROUP=root
TMPDIR=d:/djgpp/tmp/RH3caaaa
EMU387=d:/djgpp/bin/emu387.dxe
LFN=y
TEXMFMAIN=d:/djgpp/share/texmf
RHIDE_TYPED_LIBS_DJGPP.cc=stdcxx
INFOPATH=d:/djgpp/info;d:/djgpp/gnu/emacs/info
INFO_COLORS=0x1f.0x31
INFO_LINES=40
ESCDELAY=100
CMDLINE=gxx -o 141a.exe 141a.cc


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

- Raw text -


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