Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add libcurl in clion

After install sudo apt-get install libcurl4-openssl-dev

i trying to add curl in cmake of clion,but i can't understand how make this. this my standart cmake file

cmake_minimum_required(VERSION 3.6)
project(untitled3)

set(CMAKE_CXX_STANDARD 11)

set(SOURCE_FILES main.cpp)

add_executable(untitled3 ${SOURCE_FILES})
like image 838
Фарсук Фарсейкин Avatar asked Oct 24 '25 20:10

Фарсук Фарсейкин


1 Answers

This should be able to help you.

cmake_minimum_required(VERSION 3.3)
project(untitled3)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -lcurl")

set(SOURCE_FILES main.cpp)
add_executable(untitled3 ${SOURCE_FILES})
target_link_libraries(untitled3 curl)
like image 102
Seek Addo Avatar answered Oct 26 '25 17:10

Seek Addo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!