home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / g / bug / 2111 < prev    next >
Encoding:
Text File  |  1993-01-02  |  3.8 KB  |  132 lines

  1. Newsgroups: gnu.g++.bug
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!igc.apc.org!madavis
  3. From: madavis@igc.apc.org (Marilyn Davis)
  4. Subject: memmove & seekg/streampos trouble
  5. Message-ID: <9301022313.AA05868@igc.apc.org>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Sat, 2 Jan 1993 23:13:47 GMT
  10. Approved: bug-g++@prep.ai.mit.edu
  11. Lines: 119
  12.  
  13. Dear g++ experts,
  14.  
  15. I am trying to port my application from Liant C++ to GNU g++.  It 
  16. almost works except for two error messages from the linker:
  17.  
  18. undefined            first referenced
  19.  symbol                  in file
  20. seekp__8iostreamlQ243ios8seek_dir   /usr/tmp/cca141441.o
  21. memmove                             /usr/local/lib/libg++.a
  22.  
  23. I have pared things down to a little tiny program that gives the
  24. same results.  It is at the end of this file.
  25.  
  26. I am running on an Everex Step 386 with Interactive Unix System V.
  27.  
  28. The command I give for the compile:
  29.  
  30. g++ -o test -v /usr/local/lib/gcc-lib/i386-sco3.2v4/2.3.2/atexit.o test.cxx
  31.  
  32. The /usr/.../atexit.o file is a hack for the Interactive system because
  33. it doesn't have an atexit function.
  34.  
  35. The output from the compile:
  36.  
  37. Reading specs from /usr/local/lib/gcc-lib/i386-sco3.2v4/2.3.2/specs
  38. gcc version 2.3.2
  39.  /usr/local/lib/gcc-lib/i386-sco3.2v4/2.3.2/cpp -lang-c++ -v -undef
  40.  -D__GNUC__=2 -D__GUUG__=2 DD__cpusllus -D__i386 -D_M_I386-D_M_I86
  41.  -D_M_I86SM -D_M_SDATA -D_M_STEXT -D__unix -D_M_UNIX -D_M_XENIX
  42.  -D_M_SYS5 -D_M_SYSV -D_M_SYSV -D_M_SYS3 -D_M_SYSIII -D_M_COFF
  43.  -D_M_BITFIELDS -D_M_WORDSWAP -Di386 -DM_I386 -DM_I86 -DM_I86SM
  44.  -DM_SDATA -DM_STEXT -Dunix -DM_UNIX -DM_XENIX -DM_SYS5 -DM_SYSV
  45.  -D_M_SYSV -DM_SYS3 -DM_SYSIII -DM_COFF -DM_BITFIELDS -DM_WORDSWAP
  46.  test.cxx /usr/tmp/cca14144.i
  47. GNU CPP version 2.3.2 (80386, ATT syntax)
  48.  /usr/local/lib/gcc-lib/i386-sco3.2v4/2.3.2/cc1plus /usr/tmp/cca14144.i
  49.  -quiet -dumpbase test.cc -version -o /usr/tmp/cca14144.s
  50. GNU C++ version 2.3.2 (80386, ATT syntax) compiled by GNU C version 2.3.2.
  51.  as -o /usr/tmp/cca141441.o /usr/tmp/cca14144.s
  52.  ld -o test /lib/crt1.o /usr/local/lib/gcc-lib/i386-sco3.2v4/2.3.2/crtbegin.o
  53.  -L/usr/local/lib/gcc-lib/i386-sco3.2v4/2.3.2 -L/usr/local/lib
  54.  /usr/local/lib/gcc-lib/i386-sco3.2v4/2.3.2/atexit.o /usr/tmp/cca141441.o
  55.  -lg++ -lgcc -lc -lgcc /usr/lccal/lib/gcc-lib/i386-sco3.2v4/2.3.2/crtend.o
  56.  /lib/crtn.o
  57. undefined            first referenced
  58.  symbol                  in file
  59. seekp__8iostreamlQ243ios8seek_dir   /usr/tmp/cca141441.o
  60. memmove                             /usr/local/lib/libg++.a
  61. ld fatal: Symbol referencing errors. No output written to test
  62. --------------------------------------------
  63. That's all the info I can think to include.  Please write me if
  64. you have any questions or answers.
  65.  
  66. Thank you in advance.
  67.  
  68. Marilyn Davis
  69. Frontier Systems
  70. madavis@igc.org
  71. (415) 493-3631
  72.  
  73. p.s. Here comes the test program:  test.cxx .
  74.  
  75. ------------------------------------------------------------
  76.  
  77. extern "C" {
  78. #include <fcntl.h>
  79. }
  80. #include <iostream.h>
  81. #include <fstream.h>
  82. //  ***************************************************
  83. //  
  84. //   One class only, Conf
  85. //
  86. class Conf
  87.   {
  88.     public:
  89.       Conf();
  90.       void close_info();
  91.       fstream& open_info(int mode = ios::app);
  92.     private:
  93.       streampos _end_offset;
  94.       fstream _info_file;
  95.       char _info_fname[20];
  96.   };
  97.  
  98. Conf::Conf()
  99.   {
  100.     strcpy(_info_fname,"test.file");
  101.   }
  102.  
  103. void Conf::close_info()
  104.   {
  105.     (ios&)_info_file.seekp((streamoff)0,ios::end);
  106.     _end_offset = _info_file.tellp();
  107.     _info_file.close();
  108.   }                                            
  109.  
  110. fstream& Conf::open_info(int mode)
  111.   {
  112.     _info_file.open(_info_fname,mode);
  113.     return _info_file;
  114.   }            
  115.  
  116. //  *******************************************
  117. //
  118. //   And the main() - pretty simple
  119. //
  120.                 
  121. int main()
  122.   {
  123.     Conf * the_conf = new Conf;
  124.  
  125.     ostream& strm = (ostream&)the_conf->open_info();
  126.     strm << 'x';
  127.     the_conf->close_info();        
  128.     delete the_conf;
  129.     return 1;
  130.   }
  131.  
  132.