/usr/bin/ld: cannot find -lgmp - centos

[root# bncsutil]# make
g++ -Wall -O3 -I ../ -Wno-multichar -fPIC -shared -lgmp bsha1.o cdkeydecoder.o checkrevision.o decodekey.o file.o libinfo.o oldauth.o nls.o pe.o sha1.o stack.o -o libbncsutil.so
/usr/bin/ld: cannot find -lgmp
collect2: ld returned 1 exit status
make: *** [libbncsutil.so] Error 1
I try to do this in centos-6-x86-devel.
Gmp is already installed. Seems like something wrong with path, but i don't know what exactly do.

sudo apt-get install libgmp3-dev
Did the trick for me.(for Ubuntu)

I had this problem with Centos:
yum install gmp-devel.x86_64
fixed it for me for eventmachine ruby gem that would not install. Hope that helps someone.

For me, the problem was that LIBRARY_PATH was not correctly set to the directory containing libgmp.

Related

sslscan.c:94:25: fatal error: openssl/err.h: No such file or directory compilation terminated. #163

I am need to install sslscan tool for ssl scanning (from here) in ubuntu virtual machine (virtualbox).
Following their installation instructions provided here, I installed openssl-chacha from here. Note that I am aware that this fork of openssl contains weak cipehrs (I use the tool and openssl for testing-scanning purposes not real application).
Then, after installing the above openssl, the first thing I did is executing: make. Note that it is unclear to me when to use these commands that he sslscan mentioned here (I did not execute them). But I want to use the chacha version of openssl:
apt-get install build-essential git zlib1g-dev
apt-get build-dep openssl
make static
When I try to run the command: make I get this error:
make: git: Command not found
cc -o sslscan -Wall -Wformat=2 -Wformat-security -pie -z relro -z now -L/usr/local/lib -L/usr/local/ssl/lib -L/usr/local/opt/openssl/lib -L/opt/local/lib -D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIE -I/usr/local/include -I/usr/local/ssl/include -I/usr/local/ssl/include/openssl -I/usr/local/opt/openssl/include -I/opt/local/include -I/opt/local/include/openssl -DVERSION=\"1.11.11\" sslscan.c -lssl -lcrypto -ldl
/usr/bin/ld: /usr/local/ssl/lib/libssl.a(s2_clnt.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libssl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:91: recipe for target 'sslscan' failed
make: *** [sslscan] Error 1
I am in this directory: /home/myuser/Downloads/sslscan-master
I made sure that openssl in:
/usr/local/ssl
Can you please point to me what is missing? I am not familiar with Linux system (Windows user) but I prefer to use the tool in Linux. So I will appreciate your help and patience.
make: git: Command not found
So start by installing the git command:
apt-get install git
(or maybe git-core)

/usr/bin/ld: cannot find -lstdc++ for Ubuntu while trying to "swift build" Perfect2 project

Description:
I've followed the installation steps for Swift3 and Perfect2
and I've cloned the PerfectTemplate test project proposed by Perfect and I've tried swift build
Error Message:
warning: minimum recommended clang is version 3.6, otherwise you may
encounter linker errors. Linking ./.build/debug/PerfectTemplate
/usr/bin/ld: cannot find -lstdc++ clang: error: linker command failed
with exit code 1 (use -v to see invocation) :0: error: link
command failed with exit code 1 (use -v to see invocation)
:0: error: build had 1 command failures error: exit(1):
/etc/swift301/usr/bin/swift-build-tool -f
/home/XXXX/ClionProjects/PerfectTemplate/.build/debug.yaml
What I've tried:
I've gone on different SO questions that seemed similar but all on different projects and attempted to try their solutions without luck:
For example:
Matlab Kalman /usr/bin/ld: cannot find -lstdc++
I also noticed the warning coming from the clang version, I am aware that my current version is 3.4, but that is what was installed via sudo apt-get install clang as mentioned in the documentation.
I've also tried installing the 3.6 version of clang with: sudo apt-get install clang-3.n
However, after when I try swift build again I get the following error:
error: invalid inferred toolchain: could not find clang
Question:
How do I get rid of the /usr/bin/ld: cannot find -lstdc++ error, so I can build the PerfectTemplate project?
Try this. It might not work, but it's worth a shot.
Update packages and dependencies:
sudo apt-get update
Then install clang 3.6:
sudo apt-get install clang-3.6
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.6 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.6 100
I hope this helps, but apologies if it doesn't. Best of luck!
If this error appears:
/usr/bin/ld.gold: error: cannot open
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../libstdc++.‌​so: No
such file or directory
It's most likely that the libstdc++.so symbolic link points to an inexisting file.
In my case it was pointing to:
/usr/lib/libstdc++.so -> /usr/lib/libstdc++.so.6
Which was incorrect because libstdc++.so.6 did not exist in that area. Simply find it's location via: sudo find / -name libstdc++.so.6 which gave me:
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
Then recreate the link with:
sudo rm /usr/lib/libstdc++.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/libstdc++.so
sudo apt-get install build-essential
I faced with same problem and update-alternatives didn't help me, but after
sudo apt-get update && sudo apt-get upgrade
swift build ran successfully. Looks like some dependencies were deprecated.

Emacs 25.1 on lubuntu 16.04 won't configure due to missing libpng

I am attempting to install emacs 25.1 on lubuntu 16.04, and having some trouble. After downloading and extracting the tar, I navigate to the emacs 25.1 directory then..
./configure
The configuration stops when I receive the message
configure: error: The following required libraries were not found:
libpng
Maybe some development libraries/packages are missing?
If you don't want to link with them give
--with-png=no
as options to configure
When I try sudo apt install libpng-dev
I get the message
Note, selecting 'libpng12-dev' instead of 'libpng-dev'
libpng12-dev is already the newest version (1.2.54-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
I tried reinstalling libpng12-dev using the below string, which didn't help at all.
sudo apt-get install --reinstall libpng12-0=1.2.54-1ubuntu1
I'm stuck here, I've googled around for a while and can't find any solutions that have actually worked.
I have the same problem. After I checked the config.log file, I found out that because I already installed Anaconda3 python
when gcc compile emacs it uses some libpng... found in Anconda3 directory.
So I remove related Anaconda3 directory in PATH, everything turns out right.
The wrong version:
configure:15301: result: -lz
configure:15407: checking for png
configure:15437: gcc -o conftest -g3 -O2 -I/etc/anaconda3/include/libpng16 conftest.c -lpng16 -lz -lm -lX11 >&5
/usr/bin/ld: cannot find -lpng16
The right version:
configure:15301: result: -lz
configure:15407: checking for png
configure:15437: gcc -o conftest -g3 -O2 -I/usr/include/libpng12 conftest.c -lpng12 -lz -lm -lX11 >&5
configure:15437: $? = 0
configure:15452: result: yes
Hope that would be helpful!
The solution is to remove the default version of libpng-dev (1.2) and explicitly install version 1.6: sudo apt-get remove libpng-dev && sudo apt-get install libpng16-dev
Explicit versions of dependencies don't seem to be documented in the readme files.

Scons in Mongodb

When i run scons --ssl all, it throws an error:
g++ -o build/linux2/release/ssl/mongo/util/net/ssl_manager.o -c
-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wno-unknown-pragmas -Winvalid-pch -pipe -fno-builtin-memcmp -O3 -DBOOST_ALL_NO_LIB -D_SCONS -DMONGO_EXPOSE_MACROS -DSUPPORT_UTF8 -D_FILE_OFFSET_BITS=64 -DMONGO_SSL -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_EXECINFO_BACKTRACE -DNETSNMP_NO_INLINE -Ibuild/linux2/release/ssl/third_party/libstemmer_c/include -Isrc/third_party/libstemmer_c/include -Ibuild/linux2/release/ssl/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/release/ssl/third_party/boost -Isrc/third_party/boost -Ibuild/linux2/release/ssl/third_party/pcre-8.30 -Isrc/third_party/pcre-8.30 -Ibuild/linux2/release/ssl -Isrc -Ibuild/linux2/release/ssl/mongo -Isrc/mongo -Ibuild/linux2/release/ssl/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/release/ssl/third_party/snappy -Isrc/third_party/snappy -Ibuild/linux2/release/ssl/third_party/v8/include -Isrc/third_party/v8/include src/mongo/util/net/ssl_manager.cpp
src/mongo/util/net/ssl_manager.cpp: In member function 'void
mongo::SSLManager::_setupFIPS()':
src/mongo/util/net/ssl_manager.cpp:187: error: 'FIPS_mode_set' was not
declared in this scope scons: *
[build/linux2/release/ssl/mongo/util/net/ssl_manager.o] Error 1 scons:
building terminated because of errors.
How to fix this issue. Using Ubuntu 12.04
To address this error make sure that you have a version of OpenSSL installed that defines FIPS_mode_set. Some versions of 0.9.8 for example don't. Upgrading to 1.0.1 should address.
If you are already on 1.0.1 make sure that correct OpenSSL headers and libraries are being used by scons. You can set explicitly by adding the include and lib paths as a command line arguments, as follows:
scons --ssl --cpppath /usr/local/openssl/1.0.1e/include --libpath /usr/local/openssl/1.0.1e/lib all
Where the paths provided are the actual paths of your OpenSSL include and libraries.
For those who have the same issue with OSX on Mac. Here is what you need to include:
scons --ssl --cpppath=/usr/local/opt/openssl/include --libpath=/usr/local/opt/openssl/lib all
assuming you've downloaded openssl with brew
brew install openssl

Installing Term::TermKey returns error

I have a problem while installing Term::TermKey with CPAN and I can't find information about how to solve it. Here is an output:
cpan[9]> install Term::TermKey
Running install for module 'Term::TermKey'
Running Build for P/PE/PEVANS/Term-TermKey-0.10.tar.gz
Checksum was ok
'/usr/bin/perl Build.PL installdirs=site' returned status 256, won't make
Running Build test
Make had some problems, won't test
Running Build install
Make had some problems, won't install
May someone help me?
//edit
I installed libtermkey but I still have a problem:
Building Term-TermKey
cc -I/usr/lib/perl5/core_perl/CORE -DXS_VERSION="0.10" -DVERSION="0.10" -fPIC -I/usr/local/include -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -o lib/Term/TermKey.o lib/Term/TermKey.c
ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Term/TermKey/TermKey.bs')
cc -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -L/usr/local/lib -fstack-protector -o blib/arch/auto/Term/TermKey/TermKey.so lib/Term/TermKey.o -L/usr/local/lib -ltermkey
PEVANS/Term-TermKey-0.10.tar.gz
./Build -- OK
'YAML' not installed, will not store persistent state
Running Build test
t/00use.t ........... 1/1
# Failed test 'use Term::TermKey;'
# at t/00use.t line 8.
# Tried to use 'Term::TermKey'.
# Error: Can't load '/root/.cpan/build/Term-TermKey-0.10-Y5j3Oz/blib/arch/auto/Term/TermKey/TermKey.so' for module Term::TermKey: libtermkey.so.1: nie można otworzyć pliku obiektu dzielonego: Nie ma takiego pliku ani katalogu at /usr/lib/perl5/core_perl/DynaLoader.pm line 190.
It fails on every test. I don't know why. There is -L/usr/local/lib -ltermkey, so I've checked this directory:
ciembor#peace lib]$ ls | grep libtermkey
libtermkey.a
libtermkey.la
libtermkey.so
libtermkey.so.1
libtermkey.so.1.4.0
And all files are on their place...
Make sure that /usr/local/lib is also present in either $LD_LIBRARY_PATH or /etc/ld.so.conf. Without that, even if pkg-config can find the termkey.pc file which tells the compiler where the <termkey.h> files are, the (runtime) linker will not be able to link against the actual libtermkey.so file at runtime.
Alternatively, you could install libtermkey as a real package if your OS supports such - I keep a package on http://packages.leonerd.org.uk/ for Debian testing/unstable; it may also be suitable for other Debian-derived distributions such as Ubuntu.
When you install modules through CPAN, you don't see many of the error messages if the install fails. I would suggest to download Term-TermKey-0.10.tar.gz manually through http://search.cpan.org, extract it and then
perl Makefile.PL
make
make test
sudo make install
On my machine I'm told at the first step that I don't have libtermkey installed and it points me to a download.