- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Problem Calling Function from Shared Image
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2004 08:15 PM
11-07-2004 08:15 PM
Problem Calling Function from Shared Image
I have created a shared image in VMS and while trying to call dlsym I m getting the error " %LIB-E-KEYNOTFOU, key not found in tree "
Below is the code i m using:
int main(int argc, char* argv[])
{
void* lib_handle;
void (*lib_func);
const char* error;
lib_handle = dlopen("mylib", RTLD_LAZY);
if (!lib_handle) {
fprintf(stderr, "Error: %s\n", dlerror());
exit(1);
}
lib_func = dlsym(lib_handle, "test_function");
error = dlerror();
if (error) {
fprintf(stderr, "Error: %s\n", error);
exit(1);
}
//(*lib_func)();
dlclose(lib_handle);
return 0;
}
Can some tell me where i m going wrong??
Regards
Malav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2004 08:40 PM
11-07-2004 08:40 PM
Re: Problem Calling Function from Shared Image
Welcome to the OVMS forum.
The functions dlopen,dlsym and dlclose are new from version 7.2. They are wraped around the LIB$FIND_IMAGE_SYMBOL rtl function.
When you receive the %LIB-E-KEYNOTFOU that means that there is no such function in the shareable image. Have you properly linked the shareable image? For yours example the command will be something like this:
$ LINK/SHAREABLE=mylib.exe mylib.obj, -
SYS$INPUT/OPT
symbol_vector=(test_function=procedure)
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2004 08:41 PM
11-07-2004 08:41 PM
Re: Problem Calling Function from Shared Image
if you didn't compile the files /NAMES=AS_IS that went into the shareable image, I'd expect the C compiler to uppercase all names.
HTH,
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2004 08:53 PM
11-07-2004 08:53 PM
Re: Problem Calling Function from Shared Image
ANALIZE/IMAGE mylib.exe/GST
to check which global symbols are defined. At the end of the listing you will receive the GLOBAL SYMBOL DIRECTORY with symbol names.
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2004 09:50 PM
11-07-2004 09:50 PM
Re: Problem Calling Function from Shared Image
Thanks Bojan for ur reply...
"ANALIZE/IMAGE mylib.exe/GST" helped me out. Actually found out that in the opt file instead of using the procedure name, we got to use the "real" name.. which can be found from the " cxx$demangler_db." file.
so instead of using
symbol_vector=(test_function=procedure)
-- where test_function is the actual function name
we got to use.
symbol_vector=(
Regards
Malav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2004 09:56 PM
11-07-2004 09:56 PM
Re: Problem Calling Function from Shared Image
See http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=718061
cu,
Martin