Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

micro-service ( trying to build in Ubuntu 18.04 machine), but zlip path is empty in CMakeLists.txt #28

Open
DLinIoTedge opened this issue Jun 10, 2021 · 2 comments

Comments

@DLinIoTedge
Copy link

Hello Ivan, good morning.

I am working with steps and code given in https://github.com/ivanmejiarocha/micro-service , during mentioned workflow there is challenge coming up from non availability of functions from zlip

Machine: Ubuntu 18.04 X86 AMD
libcpprest.a is created by using ./build_dependencies.sh
cmake is done in micro-service/build$
make -j 8 the following error message coming ( done in micro-service/build )

 **undefined reference to `deflate'**

_http_compression.cpp:(.text._ZN3web4http11compression7builtin20zlib_compressor_base8compressEPKhmPhmNS1_14operation_hintERmRb[ZN3web4http11compression7builtin20zlib_compressor_base8compressEPKhmPhmNS1_14operation_hintERmRb]+0x17f): undefined reference to `deflate'
collect2: error: ld returned 1 exit status

HINT
ZIP_LIBRARY appears to be empty in after
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
@ivanmejiarocha
Could you kindly advice
Thanks a lot in advance
jk

@yfyang86
Copy link

yfyang86 commented Dec 9, 2022

TL;DR:

  • Install ZLIB-DEV: apt install zlib1g-dev
  • add -lz to your CMakefile (to anywhere you like to define the target_link_libraries).

Long ANS

In the CMakefile. Only ${CPPRESTSDK_LIBRARY} ${OPENSSL_LIBS} ${Boost_LIBRARIES} are added, but not the ZLIB_LIBRARY one.

# library search paths ...
if(APPLE)
    set(OPENSSL_LIBS "/usr/local/Cellar/openssl/${OPENSSL_VERSION}/lib/libssl.1.0.0.dylib;/usr/local/Cellar/openssl/${OPENSSL_VERSION}/lib/libcrypto.1.0.0.dylib")
    set(CPPRESTSDK_LIBRARY "${PROJECT_SOURCE_DIR}/libs/cpprestsdk/build.release/Binaries/libcpprest.a")
    set(ZIP_LIBRARY "/usr/local/Cellar/zlib/1.2.11/lib/libz.dylib")

    set(LIBRARIES_SEARCH_PATHS ${OPENSSL_LIBS} ${Boost_LIBRARIES} ${CPPRESTSDK_LIBRARY} ${ZIP_LIBRARY})
else()
    set(OPENSSL_LIBS "${OPENSSL_LIBRARIES}")
    set(CPPRESTSDK_LIBRARY "${PROJECT_SOURCE_DIR}/libs/cpprestsdk/build.release/Binaries/libcpprest.a")

    set(LIBRARIES_SEARCH_PATHS ${CPPRESTSDK_LIBRARY} ${OPENSSL_LIBS} ${Boost_LIBRARIES})
endif()

@ivanmejiarocha
Copy link
Owner

Please verify why is falling into the APPLE case, due to you are on Linux it should no be looking for the zip library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants