Incorrect shared libraries picked in AIX - aix

While building a particular module, I get the below error:
ld: 0711-317 ERROR: Undefined symbol: .MD5_Init
ld: 0711-317 ERROR: Undefined symbol: .SHA1_Init
ld: 0711-317 ERROR: Undefined symbol: .SHA224_Init
ld: 0711-317 ERROR: Undefined symbol: .SHA256_Init
ld: 0711-317 ERROR: Undefined symbol: .SHA384_Init
ld: 0711-317 ERROR: Undefined symbol: .SHA512_Init
ld: 0711-317 ERROR: Undefined symbol: .SHA1_Update
ld: 0711-317 ERROR: Undefined symbol: .SHA1_Final
ld: 0711-317 ERROR: Undefined symbol: .SHA224_Update
ld: 0711-317 ERROR: Undefined symbol: .SHA224_Final
ld: 0711-317 ERROR: Undefined symbol: .SHA256_Update
ld: 0711-317 ERROR: Undefined symbol: .SHA256_Final
ld: 0711-317 ERROR: Undefined symbol: .SHA384_Update
ld: 0711-317 ERROR: Undefined symbol: .SHA384_Final
ld: 0711-317 ERROR: Undefined symbol: .SHA512_Update
ld: 0711-317 ERROR: Undefined symbol: .SHA512_Final
ld: 0711-317 ERROR: Undefined symbol: .MD5_Update
ld: 0711-317 ERROR: Undefined symbol: .MD5_Final
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make: *** [entity_test] Error 8
I see that these symbols come from openssl's libcrypto.a library:-
$ nm openssl-1.0.2f/libcrypto.so|grep SHA512_Final
.SHA512_Final T 448
SHA512_Final D 3088 24
SHA512_Final d 2976 8
.SHA512_Final U -
I have exported LIBPATH=:$LIBPATH and built with -lcrypto option. However from the dump output, I still do not find the libcrypto.so from openssl being used from ldd output.
ldd lru_test
lru_test needs:
/cb/cb10b/rel/server/lib/libexpat.so
/usr/lib/libpthread.a(shr_xpg5_64.o)
/usr/lib/libiconv.a(shr4_64.o)
/cb/cb10b/rel/server/lib/liblog4cxx.so
/usr/lib/libC.a(shr_64.o)
/usr/lib/libC.a(shr2_64.o)
/usr/lib/libC.a(shr3_64.o)
/usr/lib/libC.a(ansi_64.o)
/usr/lib/libc.a(shr_64.o)
/unix
/usr/lib/libaprutil-1.so
/usr/lib/libapr-1.so
/usr/lib/libC.a(shrcore_64.o)
/usr/lib/libC.a(ansicore_64.o)
/usr/lib/libcrypt.a(shr_64.o)
/usr/lib/libexpat.a(libexpat.so.1)
/usr/lib/libiconv.a(libiconv.so.2)
ar: 0707-109 Member name libiconv.so.2 does not exist.
dump: /tmp/tmpdir22282828/extract/libiconv.so.2: 0654-106 Cannot open the specified file.
/usr/lib/libc.a(shr.o)
/usr/lib/libpthread.a(shr_xpg5.o)
/usr/lib/libcrypt.a(shr.o)
/usr/lib/libpthreads.a(shr_comm.o)
$ dump -H -X32_64 lru_test
lru_test:
***Loader Section***
Loader Header Information
VERSION# #SYMtableENT #RELOCent LENidSTR
0x00000001 0x00000117 0x000023b0 0x00000139
#IMPfilID OFFidSTR LENstrTBL OFFstrTBL
0x0000000a 0x00025560 0x00001d5a 0x00025699
***Import File Strings***
INDEX PATH BASE MEMBER
0 /cb/cb10b/cb/server/lib:/cb/cb10b/rel/server/lib:/opt/IBM/xlmass/8.1.2/lib/aix61:/opt/IBM/xlc/13.1.2/lib:/opt/IBM/xlC/13.1.2/lib:/usr/lib:/lib
1 libexpat.so
2 libpthread.a shr_xpg5_64.o
3 libiconv.a shr4_64.o
4 liblog4cxx.so
5 libC.a shr_64.o
6 libC.a shr2_64.o
7 libC.a shr3_64.o
8 libC.a ansi_64.o
9 libc.a shr_64.o
While the build has passed, the output from ldd still is quite perplexing.
1. Why does libcrypto.so not appear as a dependency in ldd?
2. However, how is the dependency for the symbols listed above being resolved by the linker?

Related

cuda: undefined reference to `cufftExecR2C'

Im using Cudas cuFFT library and therefore I have added the library path to $LD_LIBRARY_PATH. When compiling, Im using the -lcufft flag, after including the header with #include<cufft.h>. But I still receive the following errors:
/usr/bin/ld: tmpxft_000029f1_00000000-6_render.cudafe1.cpp:(.text+0x51b): undefined reference to `cufftExecR2C'
/usr/bin/ld: tmpxft_000029f1_00000000-6_render.cudafe1.cpp:(.text+0x528): undefined reference to `cufftDestroy'
/usr/bin/ld: tmpxft_000029f1_00000000-6_render.cudafe1.cpp:(.text+0x16d8): undefined reference to `cufftPlan2d'
/usr/bin/ld: tmpxft_000029f1_00000000-6_render.cudafe1.cpp:(.text+0x16f3): undefined reference to `cufftExecC2R'
/usr/bin/ld: tmpxft_000029f1_00000000-6_render.cudafe1.cpp:(.text+0x16fd): undefined reference to `cufftDestroy'
collect2: error: ld returned 1 exit status
This is a CMake project and I link via: set(CMAKE_CUDA_FLAGS_RELEASE " -I/opt/nvidia/hpc_sdk/Linux_x86_64/22.11/math_libs/include -L/opt/nvidia/hpc_sdk/Linux_x86_64/22.11/math_libs/lib64 -lcufft")
Am I missing something crucial?

library not found for libstdc++.6.0.9 not found xcode 11.1

As this library is deprecated 5 years ago, the workaround is followed in this URL http://orenjiapp.com/2018/08/22/xcode-10-ios-12-does-not-contain-libstdc6-0-9/
"Indeed this workaround has worked to build the project successfully, but I don't want to use this temporary solution if I remove that libstdc++.6.0.9.tbd and trying to build the project using libc++.1.tbd and throwing errors as shown below".
"Does anyone know what is the actual solution for this scenario?"
"Undefined symbols for architecture arm64:
"std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
std::_Rb_tree, std::_Select1st >, std::less..."
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)"
The Errors which are currently facing as follows
"Showing All Messages
Undefined symbol: std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)
Showing All Messages
Undefined symbol: std::_List_node_base::hook(std::_List_node_base*)
Showing All Messages
Undefined symbol: std::string::assign(char const*, unsigned long)
Showing All Messages
Undefined symbol: std::__throw_length_error(char const*)
Showing All Messages
Undefined symbol: std::allocator::allocator()
Showing All Messages
Undefined symbol: std::_List_node_base::unhook()
Showing All Messages
Undefined symbol: std::basic_string, std::allocator >::basic_string(char const*, std::allocator const&)
Showing All Messages
Undefined symbol: std::string::compare(std::string const&) const
Showing All Messages
Undefined symbol: std::string::operator=(char const*)
Showing All Messages
Undefined symbol: std::_Rb_tree_increment(std::_Rb_tree_node_base const*)
Showing All Messages
Undefined symbol: std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)
Showing All Messages
Undefined symbol: std::allocator::~allocator()
Showing All Messages
Undefined symbol: std::string::operator=(std::string const&)
Showing All Messages
Undefined symbol: std::basic_string, std::allocator >::basic_string(std::string const&)
Showing All Messages
Undefined symbol: std::_Rb_tree_decrement(std::_Rb_tree_node_base*)
Showing All Messages
Undefined symbol: std::_Rb_tree_increment(std::_Rb_tree_node_base*)
Showing All Messages
Undefined symbol: std::basic_string, std::allocator >::basic_string()
Showing All Messages
Undefined symbol: std::string::length() const
Showing All Messages
Undefined symbol: std::basic_string, std::allocator >::~basic_string()
Showing All Messages
Undefined symbol: std::string::c_str() const"
To resolve this issue try to follow below steps:
Clone https://github.com/Kila2/libstdc-.6.0.9.tbd
Copy two file: libstdc++.6.0.9.tbd and libstdc++.6.tbd
to path
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
and
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
(Change name Xcode.app to name version xcode)
Add the copied library (libstdc++.6.0.9.tbd) and (libstdc++.6.tbd) to “Build Phase-> Link libraries” Path of Xcode project.
Clean xcode and rebuild it

apple mach o linker error xcode 6.1

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_EntityImage", referenced from:
objc-class-ref in JSONParser.o
"_OBJC_CLASS_$_clsCommonEntity", referenced from:
objc-class-ref in JSONParser.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

PJSIP Undefined Symbols Architecture Armv7

I am trying to compile the pjsip from http://trac.pjsip.org/repos/wiki/Getting-Started/iPhone.
cd /path/to/your/pjsip/dir
$ ./configure-iphone
$ make dep && make clean && make
I get following undefined symbols error.
Undefined symbols for architecture armv7:
"_pjmedia_avi_streams_get_num_streams", referenced from:
_app_init in pjsua_app.o
_reset_dev_info in libpjmedia-videodev-arm-apple-darwin9.a(avi_dev.o)
"_pjmedia_avi_streams_get_stream", referenced from:
_app_init in pjsua_app.o
_reset_dev_info in libpjmedia-videodev-arm-apple-darwin9.a(avi_dev.o)
"_pjmedia_vid_register_factory", referenced from:
_pjmedia_avi_dev_create_factory in libpjmedia-videodev-arm-apple-darwin9.a(avi_dev.o)
"_pjmedia_vid_dev_get_local_index", referenced from:
_pjmedia_avi_dev_get_param in libpjmedia-videodev-arm-apple-darwin9.a(avi_dev.o)
_pjmedia_avi_dev_free in libpjmedia-videodev-arm-apple-darwin9.a(avi_dev.o)
"_pjmedia_vid_dev_get_global_index", referenced from:
_pjmedia_avi_dev_alloc in libpjmedia-videodev-arm-apple-darwin9.a(avi_dev.o)
"_pjmedia_avi_player_create_streams", referenced from:
_pjmedia_avi_dev_alloc in libpjmedia-videodev-arm-apple-darwin9.a(avi_dev.o)
"_pjmedia_avi_streams_get_stream_by_media", referenced from:
_pjmedia_avi_dev_alloc in libpjmedia-videodev-arm-apple-darwin9.a(avi_dev.o)
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status
make[2]: *** [../bin/pjsua-arm-apple-darwin9] Error 1
make[1]: *** [pjsua] Error 2
make: *** [all] Error 1
Please help in compiling this project in for Xcode 4.3.
It looks like you are missing a library that you should be linking against. From the symbol errors it looks like it might be called pjmedia. Make sure you are linking against all the libraries. precompiled o files that pjsip requires

Libmms and iOS 5, Xcode 4.2

Every time I try complier my that is using the libmms. I recieved follow linker error:
Undefined symbols for architecture i386:
"_Status_GetNewStatusByKey", referenced from:
_report_progress in mms.o "_Status_SetNewStatusByKey", referenced from:
_report_progress in mms.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1
(use -v to see invocation)
Any help would be helpfully