![]() |
|
#1
|
|||
|
|||
about undefined reference for 'sinf'I m writting code in c using another library(parapin) and making Makefile .but there is a error like
undefined reference to `sinf' undefined reference to `ceilf' although i have added math.h library in my code . I tried to run simple programme using math.h and it run.but in making Makefile it is giving me error |
|
#2
|
||||
|
||||
Re: about undefined reference for 'sinf'That's because there is no sinf() and ceilf() in standard C -- and obviously not in your compiler.
If the functions are in the parapin library, you have to link it during your compile/build. Please don't forget to read the Guidelines so we can help you to the best of our ability. Without the guidelines, we will probably have to ask more questions to get enough info, which will waste a lot of time. #1 thru #4 are the most important. __________________
Age is unimportant -- except in cheese |
|
#3
|
|||
|
|||
Re: about undefined reference for 'sinf'Quote:
1. Post the code and the Makefile. 2. Tell us exactly what the error is. (Paste the message into your post; don't paraphrase.) 3. Tell us what compiler you are using. The functions sinf(), cosf(), ceilf(), etc. are part of the C99 Standard library, but not C89 or C++ standard libraries. Some compilers may support them; some do not. If you have source code, you can replace sinf() with sin(), ceilf() with ceil(), etc. Or, if this is a linker error using object or library files from other sources, you can make your own versions of the xxxf() functions and link them in. There may be compiler command line switches that let you include such things (or, maybe, not). Regards, Dave |
|
#4
|
||||
|
||||
Re: about undefined reference for 'sinf'Quote:
Quote:
__________________
Age is unimportant -- except in cheese |
|
#5
|
|||
|
|||
Re: about undefined reference for 'sinf'Quote:
Of course the problem is that if someone didn't know sinf() is a C99 Standard library function he/she might not even think of looking in the "new" <math.h>. Borland and Microsoft users: fuggadaboudit. GNU users: check the GNU documentation about library functions. General resources for the casual reader abound: dinkumware is a good resource delorie is another good one Regards, Dave |
Recent GIDBlog
Observations of Iraq by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Linker error] undefined reference to `WinMain@16' | vermin1302 | C++ Forum | 4 | 24-Feb-2006 09:39 |
| c++ inheritance | illbemissingu | C++ Forum | 14 | 23-Oct-2005 17:35 |
| Undefined reference to 'GetDefaultPrinterA' | joergf | C++ Forum | 3 | 06-Oct-2005 14:00 |
| Linker Errors with Dev-C++ 5 | Gamer_2k4 | C++ Forum | 1 | 18-Apr-2005 11:08 |
| fltk-2.0 cvs | Plumb | FLTK Forum | 20 | 13-Nov-2004 07:10 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The