I have a libname.a
static library that works fine when I use gcc:
gcc -c main.c -o main.o ;
gcc main.o libname.a main
But now I would like to use CMake as the project is getting big, but I got this message and and I don't know how to include it in an appropriate way. (I tried link_target_library
and/or link_directories
and/or set(CMAKE_CC_FLAGS "absolute_path/libname.a")
.
Note that I don't have any source code for libname.a
.
/usr/bin/ld: cannot find -llibname