I've created custom shared object with one function inside - void hello();
which only prints "hello".
I'm now trying to use the SO in another project, but I can't use it (more likely - I don't know how to)
The test_lib.so
file is at the same as my main.c
.
I'm trying to include the lib in my CMakeLists.txt
as following:
cmake_minimum_required(VERSION 3.12)
project(test2 VERSION 1.0.0)
find_library(MYLIB test_lib.so)
add_executable(test main.c)
target_link_libraries(test MYLIB)
But when I try to use hello();
on my main.c I'm getting the error:
undefined reference to `hello'