Comments (4)
Hi Daniel,
You will need to additionally link the openssl libraries (libssl and libcrypto). These should probably be located at /usr/local/opt/lib.
-L /usr/local/opt/lib -lssl -lcrypto
from cpprestsdk.
I also had this problem. Thanks to @ras0219-msft!
My CMakeLists.txt:
cmake_minimum_required(VERSION 3.12)
project(main)
set(CMAKE_CXX_STANDARD 11)
##########################################################################
set(CPPRESTSDK_INCLUDE_DIR /Users/xok/DATA/Programming/libs/casablanca/Release/include)
set(CPPRESTSDK_SOURCE_DIR /Users/xok/DATA/Programming/libs/casablanca/build.debug/Binaries)
set(OPENSSL_INCLUDE_DIR /usr/local/Cellar/openssl/1.0.2p/include)
set(OPENSSL_SOURCE_DIR /usr/local/Cellar/openssl/1.0.2p/lib)
set(BOOST_INCLUDE_DIR /usr/local/Cellar/boost/1.67.0_1/include)
set(BOOST_SOURCE_DIR /usr/local/Cellar/boost/1.67.0_1/lib)
##########################################################################
set(SOURCES
main.cpp
)
##########################################################################
include_directories(${OPENSSL_INCLUDE_DIR})
include_directories(${CPPRESTSDK_INCLUDE_DIR})
include_directories(${BOOST_INCLUDE_DIR})
##########################################################################
add_executable(main ${SOURCES})
target_link_libraries(main
${CPPRESTSDK_SOURCE_DIR}/libcpprest.2.10.dylib
${CPPRESTSDK_SOURCE_DIR}/libcpprest.dylib
${OPENSSL_SOURCE_DIR}/libssl.dylib
${OPENSSL_SOURCE_DIR}/libcrypto.dylib
${BOOST_SOURCE_DIR}/libboost_system.dylib
)
from cpprestsdk.
If I include
-I/usr/local/opt/openssl/include
the output changes to:
g++ test.cpp -std=c++11 -I /Users/daniel/Desktop/workspace/casablanca/Release/include -L /Users/daniel/Desktop/workspace/casablanca/build.release/Binaries -I/usr/local/opt/openssl/include
Undefined symbols for architecture x86_64:
"_CONF_modules_unload", referenced from:
boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in test-2da509.o
"_CRYPTO_cleanup_all_ex_data", referenced from:
boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in test-2da509.o
"_CRYPTO_num_locks", referenced from:
boost::asio::ssl::detail::openssl_init_base::do_init::do_init() in test-2da509.o
"_CRYPTO_set_id_callback", referenced from:
boost::asio::ssl::detail::openssl_init_base::do_init::do_init() in test-2da509.o
boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in test-2da509.o
"_CRYPTO_set_locking_callback", referenced from:
boost::asio::ssl::detail::openssl_init_base::do_init::do_init() in test-2da509.o
boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in test-2da509.o
"_ENGINE_cleanup", referenced from:
boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in test-2da509.o
"_ERR_free_strings", referenced from:
boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in test-2da509.o
"_ERR_reason_error_string", referenced from:
boost::asio::error::detail::ssl_category::message(int) const in test-2da509.o
"_ERR_remove_thread_state", referenced from:
boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in test-2da509.o
"_EVP_cleanup", referenced from:
boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in test-2da509.o
"_OPENSSL_add_all_algorithms_noconf", referenced from:
boost::asio::ssl::detail::openssl_init_base::do_init::do_init() in test-2da509.o
"_SSL_library_init", referenced from:
boost::asio::ssl::detail::openssl_init_base::do_init::do_init() in test-2da509.o
"_SSL_load_error_strings", referenced from:
boost::asio::ssl::detail::openssl_init_base::do_init::do_init() in test-2da509.o
"boost::system::system_category()", referenced from:
___cxx_global_var_init2 in test-2da509.o
boost::asio::error::get_system_category() in test-2da509.o
"boost::system::generic_category()", referenced from:
___cxx_global_var_init in test-2da509.o
___cxx_global_var_init1 in test-2da509.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
from cpprestsdk.
Thanks Ras! it works now
from cpprestsdk.
Related Issues (20)
- Static version of the nugget for Visual Studio Express 2013 for Windows Desktop
- The web_proxy doesn't work when set proxy with uri
- Charset support gbk...
- utility::details::str_iless(str1, str2);
- [MSVC] websocketsclient_test failed due to CHECK_EQUAL(ret_msg.length(), body_str.length()) where ret_msg.length()=32 and body_str.length()=5 HOT 1
- ../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found HOT 2
- async http client post/get request demo?
- nable to add both a file stream and key-value pairs to the body of the request simultaneously
- error: building cpprestsdk:x64-linux failed with: BUILD_FAILED HOT 3
- [http_client] CN checking against caller-specified Host header doesn't strip a port number
- using cpprest and segmentation fault on ubuntu 22.04 HOT 4
- hey dont worry about
- Need to double confirm if cpprestsdk supports HTTP proxy server secured by TLS
- vcpkg install should deploy ThirdPartyNotices.txt
- Build failed on Ubuntu HOT 2
- Running the example bingrequest.cpp resulted in a crash. HOT 2
- Build fails not finding openssl on GitHub MacOS runner
- 70+ Issues when building? HOT 1
- Nuget package does not have a build for ARM64 in the Window release. HOT 2
- SSL context is not getting set in cpp code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpprestsdk.