![]() |
|
#1
|
|||
|
|||
Math function errorsHi,
I have a big program wiht lots of subroutines. This has most of the math functions in it. But, I couldn't compile the program which was compiled and ran well in redhat linux 7.3 and alpha unix operating systems. now i have redhat linux 9.0 i wrote a simple code to see where the problem is, the code: CPP / C++ / C Code:
when i compile this %cc mathfn.c /tmp/ccREyveT.o(.text+0x3c): In function `main': : undefined reference to `log' collect2: ld returned 1 exit status i get his error. i checked ld and used various options, but couldn't figure out what is going on. Same error i get for all other math functions. any help/suggestions????? thanks in advance netha Last edited by LuciWiz : 04-Jul-2005 at 12:21.
Reason: Please insert your C code between [c] & [/c] tags
|
|
#2
|
||||
|
||||
|
What happened? Forgot the code tags, eh?
Suggestions: 1) verify log() is defined in math.h -- should be no problem 2) Does the math library have to be specified to be linked into the program? Sometimes compilers don't automatically link some libs and they have to be explicitly specified. Maybe this post will help... ;-) __________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
Recent GIDBlog
Writing a book by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 14:12 |
| [Tutorial] Function Pointers | aaroncohn | C++ Forum | 4 | 17-Feb-2006 12:33 |
| [GIM] gim.h | dsmith | C Programming Language | 0 | 18-Jan-2005 09:48 |
| Revising Script style ?????? | pepee | MySQL / PHP Forum | 4 | 14-Apr-2004 05:59 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The