Skip to content Skip to sidebar Skip to footer

Android NDK: Missing LOCAL_MODULE Before Including BUILD_SHARED_LIBRARY

I'm trying to setup a test NDK project in Eclipse/ADT following this tutorial. I've created a fresh new Android project 'Test1', in which I've added these 2 files: c:\Workspace\Tes

Solution 1:

Posting this in case some other poor soul tries to copy/paste directly from that tutorial - there is something wrong with the spaces on the line LOCAL_MODULE := ndkfoo.

I think they are not proper spaces but some weird Unicode character which was messing with ndk-build, because I looked at them with a hex editor and they were 0xC2 0xA0 0xC2 0xA0 0xC2 0xA0 instead of 0x20 0x20 0x20 0x20 (which is normal spaces).

Anyone copying from their tutorial will have this error, unfortunately.

If you try to copy from the question here it should be OK, I think SO has somehow fixed them to normal spaces, but on the original site they are weird Unicode spaces that will cause ndk-build to fail.

Edit: Apparently those are non-breaking spaces. I have no idea if it's true, but I think that ndk-build didn't recognize them as whitespace, so they became part of the variable name, so I was defining a variable called "LOCAL_MODULE ", instead of "LOCAL_MODULE", which is why it was complaining about the variable being undefined.


Post a Comment for "Android NDK: Missing LOCAL_MODULE Before Including BUILD_SHARED_LIBRARY"