Dependancies for RE2 on Centos7 - linux

I am trying to install re2 on a centos7 vm, and I am having some trouble solving these dependencies:
[root#roller re2]# make testinstall
cp testinstall.cc obj
(cd obj && g++ -I/usr/local/include -L/usr/local/lib testinstall.cc -lre2 -pthread -static -o testinstall)
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make: *** [testinstall] Error 1
Any help would be great! :)
thanks!

Related

relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

I'm trying to run the following makefile for JNI in Eclipse on Ubuntu 14.04
CLASS_PATH = ../bin
vpath %.class $(CLASS_PATH)
all : libSend.so
libSend.so : Send.o
gcc -fPIC -shared -o $# $<
Send.o : Send.c Send.h
gcc -fPIC -I"/usr/lib/jvm/java-8-openjdk-amd64/include" -I"/usr/lib/jvm/java-8-openjdk-amd64/include/linux" -c $< -o $#
Send.h : Send.class
javah -classpath $(CLASS_PATH) $*
clean :
rm Send.h Send.o libSend.so
When I try to build this makefile. I'm getting the follwing error:
make all
javah -classpath ../bin Send
gcc -fPIC -shared -o libSend.so Send.o
/usr/bin/ld: Send.o: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
Send.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [libSend.so] Error 1
Please help me to resolve this issue.
My code worked when I followed #AndrewHenle's suggestion:
make clean; make all
Thank you #AndrewHenle.

Error compiling SOSlib C library

I am attempting to compile a library,
http://www.tbi.univie.ac.at/~raim/odeSolver/
this one specifically, I have gotten the necessary libraries for this.
However whenever i attempt to compile it with "make", I get the following error.
Making all in src
make[1]: Entering directory `/home/user/SOSLib/buildSOSlib/src'
/usr/bin/make all-am
make[2]: Entering directory `/home/user/SOSLib/buildSOSlib/src'
/bin/bash ../libtool --tag=CC --mode=link /usr/bin/gcc-4.8 -Wno-unknown-pragmas -Wall -Wextra -ansi -std=iso9899:1990 -g3 -gdwarf-2 -no-undefined -L/usr/lib64 -L/usr/local/lib -o libODES.la -rpath /usr/local/lib ASTIndexNameNode.lo arithmeticCompiler.lo charBuffer.lo compiler.lo cvodeData.lo cvodeSolver.lo daeSolver.lo drawGraph.lo evaluateAST.lo integratorInstance.lo integratorSettings.lo interpol.lo modelSimplify.lo nullSolver.lo odeConstruct.lo odeModel.lo odeSolver.lo processAST.lo sbml.lo sbmlResults.lo sensSolver.lo solverError.lo util.lo data.lo error.lo -lsbml -lxml2 -lsundials_ida -lsundials_kinsol -lsundials_cvodes -lsundials_nvecserial -lm -lm -ldl
libtool: link: /usr/bin/gcc-4.8 -shared -fPIC -DPIC .libs/ASTIndexNameNode.o .libs/arithmeticCompiler.o .libs/charBuffer.o .libs/compiler.o .libs/cvodeData.o .libs/cvodeSolver.o .libs/daeSolver.o .libs/drawGraph.o .libs/evaluateAST.o .libs/integratorInstance.o .libs/integratorSettings.o .libs/interpol.o .libs/modelSimplify.o .libs/nullSolver.o .libs/odeConstruct.o .libs/odeModel.o .libs/odeSolver.o .libs/processAST.o .libs/sbml.o .libs/sbmlResults.o .libs/sensSolver.o .libs/solverError.o .libs/util.o .libs/data.o .libs/error.o -L/usr/lib64 -L/usr/local/lib -lsbml -lxml2 /usr/local/lib/libsundials_ida.a /usr/local/lib/libsundials_kinsol.a /usr/local/lib/libsundials_cvodes.a /usr/local/lib/libsundials_nvecserial.a -lm -ldl -Wl,-soname -Wl,libODES.so.0 -o .libs/libODES.so.0.0.0
/usr/bin/ld: /usr/local/lib/libsundials_ida.a(ida.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libsundials_ida.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libODES.la] Error 1
make[2]: Leaving directory `/home/user/SOSLib/buildSOSlib/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/user/SOSLib/buildSOSlib/src'
make: *** [all-recursive] Error 1
What is happening here?
You are trying to build a shared library, and shared libraries must be built as position-independent code so they an be loaded and run anywhere in memory. This is achieved passing the -fPIC flag to GCC. It seems that one of the libraries (libsundials_ida.a) was not built with it.

using gcc -m32 flag cannot find -lgcc and -lgcc_s

I'm trying to compile a 32 bit assembly code(NASM) on my 64 bit Linux, but I can't, I have tried others tutorials about it and I installed ia32-libs...
When I try run it as:
gcc asm1.o -o asm1
i386 of the file input `asm1.o' is incompatible with the output i386:x86-64
And when I try run it as:
gcc -m32 asm1.o -o asm1
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: connot find -lgcc_s
collect2: error: ld returned 1 exit status
Thanks for helps.
OBS: Sorry for my english, I'm not from US.
Need to install gcc-multilib.

build alljoyn sample chat failed on android

I want to use the NDK to build the sample application chat (cpp version) of alljoyn on android. But I got the error undefined reference to 'typeinfo for ajn::BusObject'. And I have checked the alljoyn library path and I could find the libajdaemon.a and liballjoyn.a. The NDK version is r9c. The alljoyn android SDK version is 3.4.6. Can someone help me? Thanks!
The detail information is following:
/Volumes/MacintoshHD/Users/wshu_cn/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++ -Wl,-soname,libChat.so -shared --sysroot=/Volumes/MacintoshHD/Users/wshu_cn/android-ndk-r9c/platforms/android-17/arch-arm ./obj/local/armeabi/objs-debug/Chat/Chat_jni.o ./obj/local/armeabi/libstdc++.a -lgcc -no-canonical-prefixes -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -L/Volumes/MacintoshHD/Users/wshu_cn/android-ndk-r9c/platforms/android-17/arch-arm/usr/lib -L/Volumes/MacintoshHD/Users/wshu_cn/android-ndk-r9c/platforms/android-8/arch-arm/usr/lib -L../..//lib -L/Volumes/MacintoshHD/Users/wshu_cn/android-ndk-r9c/sources/cxx-stl/gnu-libstdc++/libs/armeabi -L/Volumes/MacintoshHD/Users/wshu_cn/android-ndk-r9c/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi -L./libs ../..//lib/BundledDaemon.o -lajdaemon -lalljoyn -llog -lz -ldl -lssl -lcrypto -lm -lc -lstdc++ -lgcc -lgnustl_static -lstdc++ -lc -lm -o ./obj/local/armeabi/libChat.so
/Volumes/MacintoshHD/Users/wshu_cn/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs-debug/Chat/Chat_jni.o: in function typeinfo for ChatObject:Chat_jni.cpp(.data.rel.ro._ZTI10ChatObject+0x8): error: undefined reference to 'typeinfo for ajn::BusObject'
collect2: ld returned 1 exit status

Not found z library when compiling zabbix-server

I have a problem with compiling zabbix-server on CentOS 6.2.
Command line is:
./configure --enable-server --with-mysql --with-net-snmp --with-libcurl
--with-jabber --with-ssh2 --with-openipmi --with-ldap --enable-static
But error occures:
checking for main in -lz... no
configure: error: Not found z library;
Full configure output is here: http://pastebin.ru/WmDP7UL0
I already tried to do:
yum install zlib zlib-devel zlib-static zlibrary zlibrary-devel
But it was unsuccessfully.
Thank you for your attention.
UPD. Config log posted here: http://pastebin.ru/WNtQu9eR and shows this error:
configure:7366: checking for main in -lz
configure:7385: gcc -o conftest -g -O2 -rdynamic -static conftest.c -lz -lm -lrt -lresolv >&5
/usr/bin/ld: cannot find -lm
collect2: ld returned 1 exit status
Here's the actual error:
/usr/bin/ld: cannot find -lm
But it is found previously, which points to something else. Check your ulimits to make sure you don't have a low max open file count.

Resources