ivanmejiarocha / micro-service

sample micro-service in C++
MIT License
263 stars 129 forks source link

Build error 2 #14

Closed Iskers closed 5 years ago

Iskers commented 5 years ago

I get this error when trying to build. Iv tried changing Openssl version and Cpprestsdk version in dependencies CMakeLists. Do you have a solution?

make[2]: *** No rule to make target../libs/cpprestsdk/build.release/Binaries/libcpprest.a', needed by micro-service'. Stop. make[1]: *** [CMakeFiles/micro-service.dir/all] Error 2 make: *** [all] Error 2

skjermbilde 2019-01-31 kl 00 46 05 skjermbilde 2019-01-31 kl 00 47 06
ivanmejiarocha commented 5 years ago

Hi Iskers, Did you ran first the build_dependencies.sh?

Thanks! Ivan.

Iskers commented 5 years ago

Yes, i ran it before building. I'v tried running it with both with RESTSDK_VERSION="v2.10.6" and RESTSDK_VERSION="v2.10.6".

ivanmejiarocha commented 5 years ago

Hi Iskers, It looks like you have not build the C++ REST SDK, please leave the build_dependencies.sh as is, and please verify the path:

../libs/cpprestsdk/build.release/Binaries/

it should contain the file libcpprest.a, e.i.:

$ ls ../libs/cpprestsdk/build.release/Binaries

you should see this output:

$ ls ../libs/cpprestsdk/build.release/Binaries
libcpprest.a

if that file is not there then that's your problem, the C++ REST SDK is not build.

Thanks, Ivan.

vineetdodd commented 5 years ago

The file is definetly there in my case, I am still getting the same error. It fails on step 5, and says

""" make[2]: No rule to make target /usr/local/Cellar/openssl/1.0.2p/lib/libssl.1.0.0.dylib', needed bymicro-service'. Stop. make[1]: [CMakeFiles/micro-service.dir/all] Error 2 make: *** [all] Error 2 """

Any ideas? Couldn't find anything in the comments above regarding the dylib file. In an earlier step I made sure that it would compile statically, if that helps with anything. Thanks!

emiles002 commented 5 years ago

Same error, here, after running 'make -j 8"

running macOS 10.14.3

ivanmejiarocha commented 5 years ago

you have to install OpenSSL, If you ar on macOS type:

$ brew install cmake git openssl boost zlib

then as you can see on the CMaketLists.txt we are looking for version 1.0.2p of OpenSSL:

find_package(OpenSSL 1.0.2 REQUIRED)
set(OPENSSL_VERSION "1.0.2p")

for now please replace it with the one brew installs on your system, you can look at:

/usr/local/Cellar/openssl/

I hope that helps.

pmeade commented 5 years ago

That workaround fixed it for me. Thank you so much

ivanmejiarocha commented 5 years ago

Thanks, I'm glad it helped.

DLinIoTedge commented 3 years ago

Hello Ivan, good morning.

Machine: Ubuntu 18.04 X86 AMD

libcpprest.a is created by using ./build_dependencies.sh

cmake is done in micro-service/build$
during make -j 8 the following error msg coming undefined reference to `deflate'

Could you kindly advice Thanks a lot in advance jk