0
I have a Makefile that is like this and works for what I want.
all:
gcc -c curl_code.c -lcurl
gcc -o Sete_Cliques curl_code.o main.c -lcurl
gcc -o Sete_Cliques_Serial curl_code.o sete_cliques_serial.c -lcurl
gcc -o Sete_Cliques_Threads curl_code.o sete_cliques_threads.c -lcurl
serial:
gcc -c curl_code.c -lcurl
gcc -o Sete_Cliques_Serial curl_code.o sete_cliques_serial.c -lcurl
threads:
gcc -c curl_code.c -lcurl
gcc -o Sete_Cliques_Threads curl_code.o sete_cliques_threads.c -lcurl
clean:
rm curl_code.o
rm Sete_Cliques
However, I am using the Clion IDE and I am not able to compile, follow the current Cmakelists.txt file, I need to generate an equivalent to the above Makefile
project(t3)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lcurl")
add_executable(curl_code.o curl_code.c)
add_executable(Sete_Cliques curl_code.o main.c)
add_executable(Sete_Cliques_Serial curl_code.o sete_cliques_serial.c)
add_executable(Sete_Cliques_Threads curl_code.o sete_cliques_threads.c)
Any ideas? Thank you.
Gives error when finding references to the code that is in curl_code. h
Scanning dependencies of target Sete_Cliques
[ 50%] Linking C executable Sete_Cliques
CMakeFiles/Sete_Cliques.dir/main.c.o: In function `main':
/home/joao/main.c:29: undefined reference to `curl_global_cleanup'
Hi buddy, it didn’t work. I edited the question and added the build error. Thank you
– boolean