Closed vipulgupta2048 closed 2 years ago
I have tried to follow instructions the best I could but it isn't working. Please do let me know if I am missing something?
Found the issue! Missed linking my libraries with the binary
cmake_minimum_required(VERSION 3.0)
set(CMAKE_CXX_STANDARD 17)
project(my_api)
find_package(CURL REQUIRED)
find_package(Boost REQUIRED context)
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
include_directories(${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
set(LIBS ${CURL_LIBRARIES} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES})
# Directory where lithium headers are located if not in the default include path.
include_directories(/home/vipulgupta2048/work/cpp-hello-world/include)
add_custom_target(symbols_generation COMMAND bin/li_symbol_generator ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(my_api src/server.cc)
add_dependencies(my_api symbols_generation)
target_link_libraries(my_api ${LIBS})
I followed the instruction provided here https://matt-42.github.io/lithium/getting-started to install Lithium locally. I am not sure what the automatic symbol generation needs to because it generates nothing when I run it. I created my Cmake file as below:
The code I am trying to compile is very simple on
Linux Ubuntu 20.04 x86_64 GNU/Linux
I am running the commands as mentioned in the Python
li
file to compile withI get the following error: