gingerbread issue with undefined reference for ld

Recently I tried to add a new dynamic library (.so file) in the gingerbread source. The library seems to be properly copied to the respective folder, also there was no compilation error.

But at the end moment in linking, the build failed saying.

target SharedLib: libcameraservice (out/target/product/sholes/obj/SHARED_LIBRARIES/lib*_intermediates/LINKED/
y.so)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/sholes/obj/SHARED_LIBRARIES/lib*_intermediates/z.o: in function w.cpp:109: error: undefined reference to

We can easily know that the symbols are not found in the respective linked library, but hey wait a second, we said the library is properly copied and it’s in LINKED library path. What is the problem?

The difficult the question, but the simple was the answer. The library I was linking was a c .so file, but where I was linking it was a cpp .so file. Umm .. extern “C” { } saved me :)

Advertisement

No comments yet

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.