home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.linux.slackware      I think its the one without Selinux crap      87,272 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 86,680 of 87,272   
   root to Henrik Carlqvist   
   Re: Long shot question   
   07 May 24 16:27:13   
   
   From: NoEMail@home.org   
      
   Henrik Carlqvist  wrote:   
   >   
   > Another problem which I have seen during the years is that some linkers   
   > might be picky about the order of object files and libraries. They   
   > require that object files and libraries come after object files and   
   > libraries which call their functions. In your example you have all your   
   > libraries before your object files, if you have such a linker those   
   > object files will not find their functions in the libraries. If you don't   
   > want to work out which files calls stuff in other files, one quick   
   > workaround for such a situation would be to give all files twice:   
   >   
   > gcc -o/root/bin/magic -Xlinker -Map=/ram/MAP.map  \   
   >     -lm -L/usr/lib64/gsl -lgsl -lgslcblas -rdynamic -ldl -lgpm \   
   >     magic.o eigen.o fft.o order.o xplot.o minv.o  best.o utils.o \   
   >     xtfuncs.o mygetline.o mymouse.o \   
   >     -lm -L/usr/lib64/gsl -lgsl -lgslcblas -rdynamic -ldl -lgpm \   
   >     magic.o eigen.o fft.o order.o xplot.o minv.o  best.o utils.o \   
   >     xtfuncs.o mygetline.o mymouse.o   
   >   
      
   Thanks for responding Henrik. I tried your modification to   
   the Makefile and I got a lot of "multiple defininitions" in addition   
   to the other errors.   
      
   In order to track down my problem I tried a simple example:   
      
   /*   
   program to test math functions   
   */   
   #include    
   #include    
   #include    
   #include    
   #include    
   #include    
   #include    
   #include    
   #include    
   #include    
   #include    
   #include    
   #include    
   #include    
      
   #include    
   #include    
   #include    
      
   extern gsl_rng * rgsl;  /* global generator */   
   double gsl_sf_gamma();   
      
      
   int main(argc,argv)   
   int argc;   
   char *argv[];   
   {   
   double x,y;   
      
   x=atof(argv[1]);   
   y=exp(x);   
   printf("x=%g y=%g\n",x,y);   
      
   y=gsl_sf_gamma(x);   
   printf("x=%g y=%g\n",x,y);   
   exit(0);   
   }   
      
   I compiled and linked this with the same command as in my Makefile:   
      
   gcc trym.c -o/root/bin/trym -Xlinker -Map=/ram/MAP.map   -lm -L/usr/lib64/gsl   
   -lgsl -lgslcblas -rdynamic -ldl -lgpm   
      
   The test program compiled and ran perfectly.   
      
   Thanks again Henrik.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca