- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found 'dlopen' in Linuxis basically same as 'Loadlibrary' in MS Windows.
The function would be dynamically load a library during the program run, not necessary during startup. Now how do use this ? At link stage I got following message.
: undefined reference to 'dlopen_'
Please help!
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As you haven't provided sufficient information, I'll ask you to make sure that your compiler is recent enough to include -ldl in the link options. If you have a mis-match between compiler version and linux distro, and don't want to upgrade, you could eliminate that problem by adding -ldl yourself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My compiler version 8.1, and I have used ldl option for ifort command.
The calling program has basically following lines:
pointer (addrFunc, subdll)
handle = dlopen (my_lib.so, RTLD_LAZY)
addrFunc = dlsym(handle, square)
call subdll(i, rvalue)
The shared library my_lib.so contains subroutine subdll. I wish I could see sample fortran source which use dlopen, and also build procedure. Actually the C sample source I encountered included dlfcn.h in it. I wonder if I would need similar thing in my Fortran source. Thank you for your attention.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page