-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined reference to cexpf, while cexpf not used anywhere in source #20
Comments
please attach a preprocessed file! |
… On Tue, Apr 3, 2018 at 3:50 PM, bebbo ***@***.***> wrote:
please attach a preprocessed file!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#20 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AIXahYOngwdNnmFHgKahgYsVewCJPGogks5tk34NgaJpZM4TFFST>
.
|
I've since updated the source, it's now referring to line 794 (same code though) |
changing the float to a double removes the cexpf reference, and I narrowed it down to have something to do with these lines:
float + cos / sin = complex or something like that. |
the call to
If |
But still, cexpf is not defined anywhere in libm etc, so it poses a dilemma. |
cexpf is one of the complex functions. |
Yeah, but the complex functions seem to be missing from the toolchain altogether, hence the undefined reference. I solved it for now by changing over to double. |
I know, and you knew it too: bebbo/amigaos-cross-toolchain#68
|
Oh, derp, yes. Completely forgot about this. I've been pretty busy switching jobs and traveling. |
And I think it was actually more complex to add than I thought. No pun intended. Either way, it's above what I can do at the moment |
|
the sad part: with this code there is no benefit from using cexpf... |
added libcomplex.a => use -lcomplex to use those functions |
removed libcomplex.a - adding all complex stuff to libm.a |
Seems to be already solved. but i just stumbled upon this. I once had a similar problem when porting the Atari toolchain. As with the amiga library, the c-library of atari is missing the complex functions. The solution was to add an +#undef TARGET_LIBC_HAS_FUNCTION in the target configuration header (gcc/config/m68k/mint.h in my case). For some reason, the optimizer turns a sequence of sin/cos calls into a call to cexp(), and at a later point changes that to a call to sincos(). But if you don't set the above symbol, the library call to cexp() will remain, resulting in an unresolved external. |
Why would the compiler turn this expression into cexpf?
Row 772 in projectilelib.cpp:
float rad_angle = (angle * M_PI)/180.00;
Angle is a float, so is M_PI.
The text was updated successfully, but these errors were encountered: