Issue
I am compileing application for ndk, i am getting error "undefined reference to `__errno_location'".
The error comes from a line
sprintf( buff, "%s TIOCMGET failed: %s\n", buff, strerror(errno) );
If I comment this line, the linker does not complain about the same otherwise it does.
I am trying to build my own executable for android using Sourcery G++ Lite's arm-none-linux-gnueabi-gcc tool chain.
Solution
From what I can gather, your compiler is referencing a symbol __errno_location
which cannot be found in any of the libraries which the linker is looking at.
This suggests that either:
- You don't have the correct libraries; or
- You do have the correct libraries but they're not being provided to the linker; or
- You don't have the correct headers.
If the header doesn't match the library then symbols can have the wrong name and so you can get such link errors.
It appears that you're including the compilers' LibC headers and then linking against the android library which might not always work.
Answered By - Nick
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.