Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cmake_minimum_required(VERSION 3.10)
- project(find)
- add_library(find MODULE ./src/find.c)
- add_executable(foo ./src/foo.c)
- target_link_libraries(foo ${CMAKE_DL_LIBS})
- #include <stdlib>
- #include <dlfcn.h>
- int main() {
- void* lib = dlopen(find.so);
- /* code using the library with dlsym */
- dlclose(lib);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement