<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem Calling Function from Shared Image in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/problem-calling-function-from-shared-image/m-p/3417017#M31537</link>
    <description>Of course, it would have been a useful detail to know that your source files were C++ ...&lt;BR /&gt;&lt;BR /&gt;See &lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=718061" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=718061&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;cu,&lt;BR /&gt;  Martin</description>
    <pubDate>Mon, 08 Nov 2004 05:56:43 GMT</pubDate>
    <dc:creator>Martin Vorlaender</dc:creator>
    <dc:date>2004-11-08T05:56:43Z</dc:date>
    <item>
      <title>Problem Calling Function from Shared Image</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-calling-function-from-shared-image/m-p/3417012#M31532</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;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 " &lt;BR /&gt;&lt;BR /&gt;Below is the code i m using: &lt;BR /&gt;&lt;BR /&gt;int main(int argc, char* argv[])&lt;BR /&gt;{ &lt;BR /&gt;void* lib_handle; &lt;BR /&gt;void (*lib_func); &lt;BR /&gt;const char* error; &lt;BR /&gt;&lt;BR /&gt;lib_handle = dlopen("mylib", RTLD_LAZY);&lt;BR /&gt;if (!lib_handle) {&lt;BR /&gt;fprintf(stderr, "Error: %s\n", dlerror());&lt;BR /&gt;exit(1);&lt;BR /&gt;} &lt;BR /&gt;lib_func = dlsym(lib_handle, "test_function");&lt;BR /&gt;error = dlerror();&lt;BR /&gt;if (error) {&lt;BR /&gt;fprintf(stderr, "Error: %s\n", error);&lt;BR /&gt;exit(1);&lt;BR /&gt;} &lt;BR /&gt;//(*lib_func)();&lt;BR /&gt;dlclose(lib_handle);&lt;BR /&gt;&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Can some tell me where i m going wrong??&lt;BR /&gt;&lt;BR /&gt;Regards &lt;BR /&gt;Malav</description>
      <pubDate>Mon, 08 Nov 2004 04:15:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-calling-function-from-shared-image/m-p/3417012#M31532</guid>
      <dc:creator>Malav</dc:creator>
      <dc:date>2004-11-08T04:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Calling Function from Shared Image</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-calling-function-from-shared-image/m-p/3417013#M31533</link>
      <description>Malav,&lt;BR /&gt;&lt;BR /&gt;Welcome to the OVMS forum.&lt;BR /&gt;&lt;BR /&gt;The functions dlopen,dlsym and dlclose are new from version 7.2. They are wraped around the LIB$FIND_IMAGE_SYMBOL rtl function.&lt;BR /&gt;&lt;BR /&gt;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:&lt;BR /&gt;&lt;BR /&gt;$ LINK/SHAREABLE=mylib.exe mylib.obj, -&lt;BR /&gt;SYS$INPUT/OPT&lt;BR /&gt;symbol_vector=(test_function=procedure)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Mon, 08 Nov 2004 04:40:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-calling-function-from-shared-image/m-p/3417013#M31533</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2004-11-08T04:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Calling Function from Shared Image</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-calling-function-from-shared-image/m-p/3417014#M31534</link>
      <description>Hi Malav,&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;  Martin</description>
      <pubDate>Mon, 08 Nov 2004 04:41:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-calling-function-from-shared-image/m-p/3417014#M31534</guid>
      <dc:creator>Martin Vorlaender</dc:creator>
      <dc:date>2004-11-08T04:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Calling Function from Shared Image</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-calling-function-from-shared-image/m-p/3417015#M31535</link>
      <description>Maybe another helpful tool. Do an:&lt;BR /&gt;ANALIZE/IMAGE mylib.exe/GST&lt;BR /&gt;to check which global symbols are defined. At the end of the listing you will receive the GLOBAL SYMBOL DIRECTORY with symbol names.&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Mon, 08 Nov 2004 04:53:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-calling-function-from-shared-image/m-p/3417015#M31535</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2004-11-08T04:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Calling Function from Shared Image</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-calling-function-from-shared-image/m-p/3417016#M31536</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks Bojan for ur reply...&lt;BR /&gt;&lt;BR /&gt;"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.&lt;BR /&gt;&lt;BR /&gt;so instead of using &lt;BR /&gt;&lt;BR /&gt;symbol_vector=(test_function=procedure)&lt;BR /&gt;&lt;BR /&gt;-- where test_function is the actual function name&lt;BR /&gt;&lt;BR /&gt;we got to use.&lt;BR /&gt;symbol_vector=(&lt;REAL_NAME&gt;=procedure)&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Malav&lt;BR /&gt;&lt;/REAL_NAME&gt;</description>
      <pubDate>Mon, 08 Nov 2004 05:50:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-calling-function-from-shared-image/m-p/3417016#M31536</guid>
      <dc:creator>Malav</dc:creator>
      <dc:date>2004-11-08T05:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Calling Function from Shared Image</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/problem-calling-function-from-shared-image/m-p/3417017#M31537</link>
      <description>Of course, it would have been a useful detail to know that your source files were C++ ...&lt;BR /&gt;&lt;BR /&gt;See &lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=718061" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=718061&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;cu,&lt;BR /&gt;  Martin</description>
      <pubDate>Mon, 08 Nov 2004 05:56:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/problem-calling-function-from-shared-image/m-p/3417017#M31537</guid>
      <dc:creator>Martin Vorlaender</dc:creator>
      <dc:date>2004-11-08T05:56:43Z</dc:date>
    </item>
  </channel>
</rss>

