home *** CD-ROM | disk | FTP | other *** search
/ Amiga GigaPD 3 / Amiga_GigaPD_v3_3of3.iso / netbsd / docs / mailinglist-archive / 1993-12 / text0446.txt < prev    next >
Encoding:
Text File  |  1993-06-25  |  512 b   |  31 lines

  1.  
  2. The sharelibs don't work in the following case:
  3.  
  4. prog.c
  5.  
  6. extern char string[];
  7. main(){ printf("%s\n",string); }
  8.  
  9. lib.c
  10.  
  11. char string[]="123456";
  12.  
  13. ----------------
  14. ----------------
  15.  
  16. gcc -c lib.c -fpic
  17. warning size <-1....
  18. ld -B...........
  19.  
  20. gcc prog.c -o prog /usr/lib/libtoto.so.1.1
  21.  
  22. both case:
  23. 1- string is undefined
  24. 2- string is defined but it bad
  25. (if you speficie the size of string the prog work...)
  26. Xt use a lot of these arrays to share strings (XtN..)
  27.  
  28. i don't no why gcc don't generate the correct size.
  29.  
  30.  
  31.