I have a very simple Cmake List. I recently learned that to use pow(), we have to link libraires, therefore i run target_link_libraries
Below is my CMakeList.txt
cmake_minimum_required(VERSION 3.21)
project(code C)
set(CMAKE_C_STANDARD 99)
add_executable(custom_malloc_and_free asn4/custom_malloc_and_free.c)
target_link_libraries(custom_malloc_and_free asn4/custom_malloc_and_free.c)
(project sturcture - my code custom_malloc_and_free.c is located in the directory asn4)
I get the error
[100%] Linking C executable custom_malloc_and_free
/usr/bin/ld: cannot find -lasn4/custom_malloc_and_free.c
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/custom_malloc_and_free.dir/build.make:97: custom_malloc_and_free] Error 1
make[2]: *** [CMakeFiles/Makefile2:83: CMakeFiles/custom_malloc_and_free.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:90: CMakeFiles/custom_malloc_and_free.dir/rule] Error 2
make: *** [Makefile:124: custom_malloc_and_free] Error 2
What error is this? I tried fixing it this but I have no clue what to do.