PDA

View Full Version : I cant use cosf in Xcode



02-11-2004, 09:50 PM
I'm tryng to write an OpenGL renderer in OSX using Xcode.

I build a Cocoa app and started writing my code. All was well until I tried using the cosf() function.

The code compiles just fine, but when I run my program the app quits. The debugger spits out this message...

ZeroLink: unknown symbol '_cosf'
Program received signal: "SIGABRT".

What framework do I need to include in my project to use the cosf() function and all other functions in math.h?

Thanks in advance!
Chris

OneSadCookie
02-12-2004, 12:52 AM
Looks like you need -lmx

02-12-2004, 09:08 AM
Thanks for the info!

Strangly enough the cos() function work, but the cosf() doesn't.

OneSadCookie
02-12-2004, 11:24 PM
I tried to edit that post when I made it, to say --

You may need to actually add /usr/lib/libmx.dylib to your project to get it to work with ZeroLink.

I'm guessing that "mx" means "math extension", and that it's a BSD thing... but I don't really know.