Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. cmake_minimum_required(VERSION 3.10)
  2.  
  3. project(find)
  4.  
  5. add_library(find MODULE ./src/find.c)
  6. add_executable(foo ./src/foo.c)
  7. target_link_libraries(foo ${CMAKE_DL_LIBS})
  8.  
  9. #include <stdlib>
  10. #include <dlfcn.h>
  11.  
  12. int main() {
  13. void* lib = dlopen(find.so);
  14.  
  15. /* code using the library with dlsym */
  16.  
  17. dlclose(lib);
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement