Mail Archives: djgpp/1994/03/08/06:36:05
>
>
> Thanks all of your tips - my archive site uploaded it after id
> copied all the files that i thought i required - argh.
>
> It refuses to complie my hello program
--- This is not quite right, if you look at the compiler output
you see that it is not the compilation state that falls.
> - i also implemented the patch to level3
> Ive dumped the complier output code and env settings
>
> Code
>
> #include<iostream.h>
> #include<ostream.h> // added to no avail
> #include<istream.h> //
>
> main() // also have tried int
> {
> cout << "Hello World";
> }
>
> Complier output
>
> d:/gnu/cplusinc
> d:/gnu/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.
--- Preprocessing step
> d:/gnu/bin/cc1plus.exe d:/gnu/tmp/cc007079 -fno-builtin -quiet -dumpbase hi.cc
> -version -o d:/gnu/tmp/cca07079
--- OK
--- Compiling step
> GNU C++ version 2.5.7 (80386, BSD syntax) compiled by GNU C version 2.5.7.
> hi.cc:6: warning: return type for `main' changed to integer type
--- One warning, but also successfull
--- Assembling step
> d:/gnu/bin/as.exe -o d:/gnu/tmp/ccb07079 d:/gnu/tmp/cca07079
--- OK
--- Linking step
> d:/gnu/bin/ld.exe -o hi d:/gnu/lib/crt0.o -Ld:/gnu/lib d:/gnu/tmp/ccb07079 -lgc
> c -lc -lgcc
--- Her is the problem: The linker is not able to resovle the references
to the stream class.
> hi.cc(.text+9): undefined reference to `ws(istream &)'
> hi.cc(.text+3a): undefined reference to `cout'
> hi.cc(.text+3f): undefined reference to `ostream::operator<<(const char *)'
--- This always (often ? sometimes ?) means that you have to specify additional
libaries (-lxxx) or Object Files (xxx.o). In this case, you have to specify
the libary libgpp.a, that holds the object's for the stream classes,
on your commandline.
Your calling to gcc should look like: gcc -g -o hi hi.cc -lgpp
>
> Running the program
>
> go32 version 1.11.maint3 Copyright (C) 1993 DJ Delorie
> Can't open file <hi>
--- For shure file <hi> could'nt be opened, since it was not generated by the linker.
>
> Env Settings
>
> LOADHIDATA=C:\QEMM\LOADHI.RF
> PROMPT=$P$G
> COMSPEC=C:\OS\COMMAND.COM (version 6.2)
> TEMP=c:\junk
> TMP=c:\junk
> GMKW5=c:\win\gmkw
> PATH=C:\OS;C:\WIN;C:\ZIP;C:\ODAPI;D:\GNU\BIN;C:\STAC;
> BISON_HAIRY=d:/gnu/lib/bison.hairy
> BISON_SIMPLE=d:/gnu/lib/bison.simple
> FLEX_SKELETON=d:/gnu/lib/flex.skeleton
> COMPILER_PATH=d:/gnu/bin
> C_INCLUDE_PATH=d:/gnu/include
> CPLUS_INCLUDE_PATH=d:/gnu/cplusinc;d:/gnu/include
> OBJC_INCLUDE_PATH=d:/gnu/include;d:/gnu/include/objc
> OBJCPLUS_INCLUDE_PATH=d:/gnu/include;d:/gnu/include/objc
> LIBRARY_PATH=d:/gnu/lib
> INFOPATH=d:/gnu/docs;d:/gnu/docs/djgpp
> TMPDIR=d:/gnu/tmp
> GO32TMP=d:/gnu/tmp
> GCCBIN=d:/gnu/bin
> GCINC=d:/gnu/include;d:/gnu/cplusinc
> GCCLIB=d:/gnu/lib
> GCCTMP=c:/temp
> windir=C:\WIN
>
>
Greetings Bernd
Bernd Heumann
bheuman AT msfp31 DOT gwdg DOT de
- Raw text -