Dear Toon: I found the program. I need to use -fPIC command when I compile and link to create the shared object library Thanks Philip On Thu, 2003-07-17 at 17:04, Philip Cheng wrote: > Dear Toon: > > It does not work on Sun Solaris 2.8. I even tried it with gcc 3.3 > version. It works on Red Hat Linux (even with -lg2c flag). Any clues? > > Here is my test program test.f > subroutine test(x) > write (6,*) x > return > end > > % g77 -c test.f -o test.o > % g++ > % g++ -shared -o test.so test.o -lg2c > Text relocation remains referenced > against symbol offset in file > <unknown> 0x8 test.o > <unknown> 0xc test.o > <unknown> 0x18 test.o > <unknown> 0x1c test.o > <unknown> 0x20 test.o > <unknown> 0x24 test.o > s_wsle 0x10 test.o > do_lio 0x30 test.o > e_wsle 0x38 test.o > ld: fatal: relocations remain against allocatable but non-writable > sections > collect2: ld returned 1 exit status > > > > On Thu, 2003-07-17 at 16:48, Toon Moene wrote: > > Philip Cheng wrote: > > > > > g++ -shared -o test.so test.o > > > > > s_wsle 0x10 test.o > > > do_lio 0x30 test.o > > > e_wsle 0x38 test.o > > > > These are routines from the Fortran run time library. Use the following > > command line to link your program: > > > > g++ -shared -o test.so test.o -lg2c > > > > Hope this helps, > > > > -- > > Toon Moene - mailto:toon@xxxxxxxxxxxxxxxxxxxx - phoneto: +31 346 214290 > > Saturnushof 14, 3738 XG Maartensdijk, The Netherlands > > Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html > > GNU Fortran 95: http://gcc-g95.sourceforge.net/ (under construction) > > > >