After I've installed boost for cufflinks, I ran ./configure. I am getting the following error:
checking for exit in -lboost_thread... no
checking for exit in -lboost_thread... (cached) no
checking for exit in -lboost_thread... (cached) no
error: Could not link against boost_thread !
check your config.log, it will show you in more detail why it failed:
configure:11032: checking for exit in -lboost_thread
configure:11057: g++ -o conftest -I/home/jcomeau/include -Wstack-protector -fstack-protector-all -fPIE -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -L/home/jcomeau/lib -Wl,-z,relro -Wl,-z,now -pie -L/home/jcomeau/lib conftest.cpp -lboost_thread -lminiupnpc -lminiupnpc -lminiupnpc -lminiupnpc >&5
/usr/bin/ld: warning: libboost_system.so.1.54.0, needed by /home/jcomeau/lib/libboost_thread.so, not found (try using -rpath or -rpath-link)
/home/jcomeau/lib/libboost_thread.so: undefined reference to `boost::system::system_category()'
/home/jcomeau/lib/libboost_thread.so: undefined reference to `boost::system::generic_category()'
collect2: error: ld returned 1 exit status
configure:11057: $? = 1
in this case I had to change my ./configure command from:
./configure CXXFLAGS="-I$HOME/include" LDFLAGS="-L$HOME/lib" --prefix=$HOME --with-boost-libdir=$HOME/lib
to:
./configure CXXFLAGS="-I$HOME/include" LDFLAGS="-L$HOME/lib -Wl,-rpath-link,$HOME/lib" --with-boost-libdir=$HOME/lib --prefix=$HOME
in accordance with the advice here: Get rid of "gcc - /usr/bin/ld: warning lib not found"
Related
rishabh#rishabh-virtual-machine:~/Downloads/jabcode-master/src/jabcodeWriter$ make
gcc jabwriter.o -L../jabcode/build -ljabcode -L../jabcode/lib -ltiff -lpng16 -lz -lm -O2 -std=c11 -o bin/jabcodeWriter
/usr/bin/ld: skipping incompatible ../jabcode/lib/libtiff.a when searching for -ltiff
/usr/bin/ld: cannot find -ltiff
/usr/bin/ld: skipping incompatible ../jabcode/lib/libpng16.a when searching for -lpng16
/usr/bin/ld: cannot find -lpng16
/usr/bin/ld: skipping incompatible ../jabcode/lib/libz.a when searching for -lz
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
make: *** [bin/jabcodeWriter] Error 1
I am building this https://github.com/jabcode/jabcode
but facing problem with it
jabcode folder building was completed but other two folder giving me problem.
trying to get the build done so i can run this program
While building casync using ninja build I am facing below errors related to /usr/bin/ld: . . .error adding symbols: file in wrong format
I am following casync build guideline from systemd/casync
ninja: Entering directory `build'
[1/23] Linking target casync-http
FAILED: casync-http
cc -o casync-http casync-http.p/src_casync-http.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-rpath,/root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib -Wl,-rpath-link,/root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib -Wl,--start-group src/libshared.a /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libcurl.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libssl.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libcrypto.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/liblzma.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libz.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libzstd.so -lm -Wl,--end-group
/usr/bin/ld: /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libcurl.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
[2/23] Linking target test-cadigest
FAILED: test-cadigest
cc -o test-cadigest test-cadigest.p/test_test-cadigest.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-rpath,/root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib -Wl,-rpath-link,/root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib -Wl,--start-group src/libshared.a -lacl /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/liblzma.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libselinux.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libz.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libzstd.so -lm /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libssl.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libcrypto.so -Wl,--end-group -pthread
/usr/bin/ld: /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/liblzma.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
[3/23] Linking target test-cachunker
FAILED: test-cachunker
cc -o test-cachunker test-cachunker.p/test_test-cachunker.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-rpath,/root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib -Wl,-rpath-link,/root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib -Wl,--start-group src/libshared.a -lacl /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/liblzma.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libselinux.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libz.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libzstd.so -lm /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libssl.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libcrypto.so -Wl,--end-group -pthread
/usr/bin/ld: /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/liblzma.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
[4/23] Linking target test-cachunker-histogram
FAILED: test-cachunker-histogram
cc -o test-cachunker-histogram test-cachunker-histogram.p/test_test-cachunker-histogram.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-rpath,/root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib -Wl,-rpath-link,/root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib -Wl,--start-group src/libshared.a -lacl /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/liblzma.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libselinux.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libz.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libzstd.so -lm /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libssl.so /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/libcrypto.so -Wl,--end-group -pthread
/usr/bin/ld: /root/raspcm4/sources/output/host/bin/../aarch64-buildroot-linux-gnu/sysroot/usr/lib/liblzma.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
[5/23] Linking target test-cachunk
.
.
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
I am using Buildroot as build system and after following similar post in libstdc++.so: error adding symbols: File in wrong format I changed the PATH environment like:
/root/raspcm4/sources/output/host/bin/:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/raspcm4/sources/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/bin
But still I end up getting same errors
Can anyone please let me know how to resolve this issue?
Your help will be much appreciated.
Thanks in advance
P.S: Please let me know if any info is missing here
I am trying to build an executable file for Ubuntu machine for v8.
The following is the command executed :
g++ -g -ggdb -o Engine -lm *.o -Wl,--start-group /home/atdesk-83/v8/out/native/obj.target/{tools/gyp/libv8_{base,libbase,snapshot,libplatform},third_party/icu/libicu{uc,i18n,data}}.a -Wl,--end-group -lrt -pthread
I am receiving the error :
/home/atdesk-83/v8/out/native/obj.target/tools/gyp/libv8_base.a: error
adding symbols: Malformed archive collect2: error: ld returned 1 exit
status
Can anyone help to solve this?
For a vala file 'a.vala' using gtk:
$ valac a.vala --pkg gtk+-3.0
/usr/bin/ld: skipping incompatible /usr/lib/libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/7/../../../libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible //lib/libX11.so when searching for -lX11
/usr/bin/ld: skipping incompatible //usr/lib/libX11.so when searching for -lX11
/usr/bin/ld: cannot find -lX11
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread
collect2: error: ld returned 1 exit status
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
However, the following works..
$ valac a.vala --pkg gtk+-3.0 -C
$ gcc a.c `pkg-config gtk+-3.0 --cflags --libs`
Tried removing/installing glibc-devel.x86_64 and/or glibc-devel.i686 with no use.
I'm not sure if this can help but it worth mentioning that I used to use vala normally on Fedora 26 and this problem appeared after installing a fresh Fedora 27.
I'm trying to install libevent-2.0.12-stable on Centos, but when i type sudo make,error happens(I did ./configure before make):
/bin/sh ./libtool --tag=CC --mode=link gcc -g -O2 -Wall -fno-strict-aliasing -pthread -version-info 6:1:1 -release 2.0 -o libevent.la -rpath /usr/local/libevent-2.0.12-stable/lib event.lo evthread.lo buffer.lo bufferevent.lo bufferevent_sock.lo bufferevent_filter.lo bufferevent_pair.lo listener.lo bufferevent_ratelim.lo evmap.lo log.lo evutil.lo evutil_rand.lo strlcpy.lo select.lo poll.lo epoll.lo signal.lo event_tagging.lo http.lo evdns.lo evrpc.lo -lrt
libtool: link: gcc -shared -fPIC -DPIC .libs/event.o .libs/evthread.o .libs/buffer.o .libs/bufferevent.o .libs/bufferevent_sock.o .libs/bufferevent_filter.o .libs/bufferevent_pair.o .libs/listener.o .libs/bufferevent_ratelim.o .libs/evmap.o .libs/log.o .libs/evutil.o .libs/evutil_rand.o .libs/strlcpy.o .libs/select.o .libs/poll.o .libs/epoll.o .libs/signal.o .libs/event_tagging.o .libs/http.o .libs/evdns.o .libs/evrpc.o -lrt -O2 -pthread -pthread -Wl,-soname -Wl,libevent-2.0.so.5 -o .libs/libevent-2.0.so.5.1.1
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/librt.a(clock_gettime.o): relocation R_X86_64_PC32 against undefined symbol `__errno_location##GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libevent.la] Error 1
make[2]: Leaving directory `/home/lpchou/software/httpsqs/libevent-2.0.12-stable'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/lpchou/software/httpsqs/libevent-2.0.12-stable'
make: *** [all] Error 2
Can anyone help? Thanks.
Update
After i install libevent successfully with rpm package as mentioned by #KnudLarsen, i try to install tokyocabinet using make, however same error happens:
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libm.a(s_sin.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libm.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libtokyocabinet.so.9.10.0] Error 1
I tried methods in Recompiling with -fPIC, but doesn't work. It seems there lacks some dependent packages, for i just install libevent and tokyocabinet in another centos machine and everything works fine.
CentOS 6.8 - 64bits :
tokyocabinet-1.4.32 builds OK : libtokyocabinet.so.8.23.0, libtokyocabinet.a
tokyocabinet-1.4.48 is also OK : libtokyocabinet.so.9.11.0, libtokyocabinet.a
... So I guess you have to install / reinstall your build requirements for gcc :
yum reinstall gcc-c++ glibc-devel glibc-headers kernel-headers
... to have the right files /usr/lib64/ and /usr/include/.
? Which version of tokyocabinet are you trying to build ? And where did you get it ?