Date: 27 May 1996 11:38:00 +0200 From: kl AT kl DOT in-berlin DOT de (Kaspar Landsberg) To: djgpp AT delorie DOT COM Message-ID: <69gjJ0Y$hjB@kl.in-berlin.de> Subject: gcc cannot link C++ programs w/o errors MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi all, i'm not able to {compile,link} any C++ program. It seems that DJGPP is missing something... here's what i get.. 1. gcc -lgpp -v -o prog prog.cc Reading specs from d:/lang/djgpp/lib\specs gcc version 2.7.2 d:/lang/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=0 -D__unix__ -D__i386__ -D__GO32__ -D__MSDOS__ -D__DJGPP__=2 -D__DJGPP_MINOR__=0 -D__unix -D__ i386 -D__GO32 -D__MSDOS -D__DJGPP=2 -D__DJGPP_MINOR=0 cpoint.cc d:/lang/djgpp/tmp\ccbaaaaa GNU CPP version 2.7.2 (80386, BSD syntax) #include "..." search starts here: #include <...> search starts here: d:/lang/djgpp/lang/cxx d:/lang/djgpp/include d:/lang/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/include /usr/include End of search list. d:/lang/djgpp/bin\cc1plus.exe d:/lang/djgpp/tmp\ccbaaaaa -fno-strength-reduce -fno-strength-reduce -quiet -dumpbase cpoint.cc -version -o d:/lang/djgpp/tmp\cccaaaaa GNU C++ version 2.7.2 (80386, BSD syntax) compiled by GNU C version 2.7.2. d:/lang/djgpp/bin\as.exe -o d:/lang/djgpp/tmp\ccdaaaaa d:/lang/djgpp/tmp\cccaaaaa d:/lang/djgpp/bin\ld.exe -o cpoint d:/lang/djgpp/lib\crt0.o -Ld:/lang/djgpp/lib d:/lang/djgpp/tmp\ccdaaaaa -Tdjgpp.lnk -lgcc -lc -lgcc cpoint.cc(.text+0x37): undefined reference to `ifstream::ifstream(int, char const *, int, int)' cpoint.cc(.text+0x54): undefined reference to `ofstream::ofstream(int, char const *, int, int)' cpoint.cc(.text+0x6e): undefined reference to `istream::getline(char *, int, char)' cpoint.cc(.text+0x7d): undefined reference to `ios::operator void *(void) const' cpoint.cc(.text+0xd3): undefined reference to `ostream::write(char const *, int)' cpoint.cc(.text+0xe9): undefined reference to `fstreambase::close(void)' cpoint.cc(.text+0xf8): undefined reference to `fstreambase::close(void)' 2. set >> file TMP=C:\WINDOWS\TEMP winbootdir=C:\WINDOWS COMSPEC=\COMMAND.COM SOUND=C:\SB16 MIDI=SYNTH:1 MAP:E DIRCMD=/P /O:GNE TEMP=C:\TMP MSINPUT=C:\MSINPUT CLASSPATH=D:\LANG\JAVA\LIB\CLASSES.ZIP;. DJGPP=D:\LANG\DJGPP\DJGPP.ENV PGPPATH=D:\INTERNET\PGP\263I GO32=driver D:\LANG\DJGPP\DRIVERS\VGA.GRD PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\DOS;D:\INTERNET\PGP\263I;D:\LANG\DJGPP\BIN;D:\INTERNET\XP;D:\LANG\TP7\BIN PROMPT=[$p] $h TZ=CET WINPMT=$p$g windir=C:\WINDOWS BLASTER=A220 I5 D1 H5 P330 T6 CMDLINE=gcc -v -o cpoint cpoint.cc 3. go32-v2 go32/v2 version 2.0 built Jan 23 1996 22:03:02 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. DPMI memory available: 10420 Kb DPMI swap space available: 6960 Kb 4. the program itself (don't blame me if it's rubbish code :) /** * cpoint.cc v0.3 * Dieses Programm sucht in der Datei bolzen.pp nach der XP-Versions- * angabe. Wenn gefunden (es wird nach der Zeichenfolge "R/C" an 26.-28. * Position jeder Zeile gesucht), wird diese "geloescht". -Kasi **/ #include #include int main(void) { ifstream fin("bolzen.pp", ios::in); // reading ofstream fout("kasi.ver", ios::out); // writing char zeile[81]; char version[33]; while (fin.getline(zeile,80)) { strncpy(version,zeile,32); if ((version[25] != 'R') && (version[26] != '/') \ && (version[27] != 'C')) { fout.write(zeile, 80); } } fin.close(); fout.close(); return 0; } TIA for any help, Kaspar PS Please Cc me all replies that go to the list.