Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

Incompatible dependencies when linking #52

Closed
ppires opened this issue Feb 9, 2018 · 2 comments
Closed

Incompatible dependencies when linking #52

ppires opened this issue Feb 9, 2018 · 2 comments

Comments

@ppires
Copy link

ppires commented Feb 9, 2018

I tried to build this tool following the instructions on the README, and got some errors during the linking phase:

# make
[ 17%] Built target googleapis_internal
[ 32%] Built target googleapis_utils
[ 46%] Built target googleapis_http
[ 47%] Built target googleapis_curl_http
[ 48%] Built target googleapis_json
[ 49%] Built target googleapis_jsoncpp
[ 51%] Built target googleapis_scribes
[ 52%] Built target googleapis_jsonplayback
[ 55%] Built target googleapis_oauth2
[ 56%] Built target googleapis_openssl_codec
[ 81%] Built target google_calendar_api
[ 98%] Built target google_storage_api
[ 99%] Built target calendar_sample
Linking CXX executable ../../bin/storage_sample
/usr/bin/ld: skipping incompatible /home/xxx/google-api-cpp-client/external_dependencies/install/lib/libssl.so when searching for -lssl
/usr/bin/ld: skipping incompatible /home/xxx/google-api-cpp-client/external_dependencies/install/lib/libssl.a when searching for -lssl
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: skipping incompatible /home/xxx/google-api-cpp-client/external_dependencies/install/lib/libcrypto.so when searching for -lcrypto
/usr/bin/ld: skipping incompatible /home/xxx/google-api-cpp-client/external_dependencies/install/lib/libcrypto.a when searching for -lcrypto
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
src/samples/CMakeFiles/storage_sample.dir/build.make:98: recipe for target 'bin/storage_sample' failed
make[2]: *** [bin/storage_sample] Error 1
CMakeFiles/Makefile2:711: recipe for target 'src/samples/CMakeFiles/storage_sample.dir/all' failed
make[1]: *** [src/samples/CMakeFiles/storage_sample.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

The prepare_dependencies.py executed without problems, this is the output from it:

# ./prepare_dependencies.py
   Build packages = True
   Download packages = True
   Installing packages = True
   Downloading files to /home/xxx/google-api-cpp-client/external_dependencies
   Installing packages to /home/xxx/google-api-cpp-client/external_dependencies/install
Initializing....
cmake-3.1.1.tar.gz already exists - skipping download from http://www.cmake.org/files/v3.1/cmake-3.1.1.tar.gz
cmake-3.1.1 already configured
cmake-3.1.1 already built
cmake-3.1.1 already installed
openssl-1.1.0e.tar.gz already exists - skipping download from https://www.openssl.org/source/openssl-1.1.0e.tar.gz
NOTE for Google APIs Client Library for C++ Installer:
  If this fails it might be because we guessed the wrong platform.
  Edit prepare_dependencies.py and notify us.
  See the README in the release for contact information.
openssl-1.1.0e already configured
openssl-1.1.0e already built
openssl-1.1.0e already installed
v0.3.4.tar.gz already exists - skipping download from https://github.com/google/glog/archive/v0.3.4.tar.gz
glog-0.3.4 already configured
glog-0.3.4 already built
glog-0.3.4 already installed
v2.2.0.tar.gz already exists - skipping download from https://github.com/gflags/gflags/archive/v2.2.0.tar.gz
gflags-2.2.0 already configured
gflags-2.2.0 already built
gflags-2.2.0 already installed
curl-7.54.0.tar.gz already exists - skipping download from https://github.com/curl/curl/releases/download/curl-7_54_0/curl-7.54.0.tar.gz
curl-7.54.0 already configured
curl-7.54.0 already built
curl-7.54.0 already installed
release-1.7.0.tar.gz already exists - skipping download from https://github.com/google/googlemock/archive/release-1.7.0.tar.gz
jsoncpp-src-0.5.0.tar.gz already exists - skipping download from http://downloads.sourceforge.net/project/jsoncpp/jsoncpp/0.5.0/jsoncpp-src-0.5.0.tar.gz
jsoncpp-src-0.5.0 already configured
jsoncpp-src-0.5.0 already built
>>>  Installing jsoncpp-src-0.5.0

Finished processing ['cmake', 'openssl', 'glog', 'gflags', 'curl', 'gmock', 'jsoncpp']

And finally my system:

# uname -a
Linux xxx 3.16.0-4-586 #1 Debian 3.16.43-2+deb8u5 (2017-09-19) i686 GNU/Linux

# lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 8.9 (jessie)
Release:	8.9
Codename:	jessie

Why are these dependencies incompatible?

Thanks for the help!

@aiuto
Copy link
Contributor

aiuto commented Feb 9, 2018

My advice is to forget about prepare_dependencies completely. If you want to produce software that you trust, you should understand the provenance of all your dependencies. That goes doubly true for any crypto code.

Get the newest versions of openssl and curl. Build and install them first. Then do the rest for the other libraries. Remove external-dependencies completely, delete all the cmake cached data and try to build and link again.

OR... since you are Linux based, just install the required packages with apt-get. Something like
sudo apt-get install libcurl4-openssl-dev libjsoncpp-dev libgoogle-glog-dev libgflags-dev

@tmatsuo
Copy link
Contributor

tmatsuo commented Jun 26, 2019

Thanks for filing the issue, but we deprecated this repository, so closing.

@tmatsuo tmatsuo closed this as completed Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants