GNU issues: undefined reference to '_rand'
Greetings,
I am trying to compile legacy a code that worked well with f77 and g77 on linux platform. I am trying to use g95 since f77 and g77 are not available. The code is mostly in fortran and uses few c functions among. I am getting the undefined reference error for rand: (.data+0x4): undefined referenec to '_rand' I am defining my own function RANDOM and rand in an include file but I am not sure why it is failing to link and giving me such error? external rand double precision rand #define RANDOM rr(nq) I am puzzled by why g95 is giving me such issues?! thanks! |
Hi, welcome to LQ!
How are you invoking the compiler? For all I know you simply haven't told it which library to link your old code against. The error you see is not a compiler error, it's a linker one. Cheers, Tink |
Quote:
But you will have to tell, which Linux OS, you are using. Should be be told by every question : http://www.linuxquestions.org/linux/...Ask_a_Question .. |
All times are GMT -5. The time now is 06:20 AM. |