Reputation: 443
I'm trying to compile a source code (a bunch of .cpp files in this case), which depend on a 3-rd party library. I have the .h and .so of the 3-rd party library, I can compile the code, but not link, getting missing symbols errors. Running the whole ordeal on linux (Debian)
I'm doing it with standard clang++ compiler using Android NDK 27, like so
/home/iot/android-ndk-r27/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi25-clang++ -Wnon-virtual-dtor -fvisibility=hidden -fvisibility-inlines-hidden -O3 -ggdb -mfpu=neon -Wall -Wextra -Wpointer-arith -pipe -D_GNU_SOURCE -D_REENTRANT -D__ACE_INLINE__ -I /home/iot/ACE_wrappers/ -I /home/iot/ACE_wrappers/TAO -L /home/iot/ACE_wrappers/lib ControlDict_c.cpp DataInterfaces_c.cpp OAError_c.cpp OnAirContext_c.cpp OnAirTypes_c.cpp OnAir_c.cpp SQLEngine_c.cpp idl_stream_c.cpp
As you can see I'm specifying both include and lib locations, but for some reason symbols are not getting resolved during linking resulting in undefined symbol errors:
ld.lld: error: undefined symbol: CORBA::string_dup(char const*)
>>> referenced by String_Traits_Base_T.h:47 (/home/iot/ACE_wrappers/TAO/tao/String_Traits_Base_T.h:47)
>>> /tmp/idl_stream_c-2ef846.o:(idl_stream::stream::stream(unsigned int))
>>> referenced by String_Traits_Base_T.h:47 (/home/iot/ACE_wrappers/TAO/tao/String_Traits_Base_T.h:47)
>>> /tmp/DataInterfaces_c-18580a.o:(OnAirInterfaces::BackDeltaItems::BackDeltaItems(unsigned int))
>>> referenced by String_Traits_Base_T.h:47 (/home/iot/ACE_wrappers/TAO/tao/String_Traits_Base_T.h:47)
>>> /tmp/idl_stream_c-2ef846.o:(bool TAO::demarshal_sequence<TAO_InputCDR, idl_stream::collection>(TAO_InputCDR&, TAO::unbounded_value_sequence<idl_stream::collection, int>&))
>>> referenced 404 more times
I tried to find a switch that would pass the exact path/name of the shared lib where the symbol is defined, but I didn't manage. What am I missing? The output of compilation should be a shared library (.so)
Thanks in advance.
Upvotes: 0
Views: 26