<?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: How to call Fortran routine from C++ code ? in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/how-to-call-fortran-routine-from-c-code/m-p/4328116#M45009</link>
    <description>Abdelali,&lt;BR /&gt;&lt;BR /&gt;The complex external name is caused by "name mangling". Somewhat simplified, name mangling encodes the parameter list type information and the external name.&lt;BR /&gt;&lt;BR /&gt;I do not have the time to check Steve's syntax, but the approach is correct, having constructed cross-language calls to/fro C++ many times.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
    <pubDate>Tue, 23 Dec 2008 18:59:36 GMT</pubDate>
    <dc:creator>Robert Gezelter</dc:creator>
    <dc:date>2008-12-23T18:59:36Z</dc:date>
    <item>
      <title>How to call Fortran routine from C++ code ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-call-fortran-routine-from-c-code/m-p/4328114#M45007</link>
      <description>I'm trying it but I got "%ILINK-I-UDFSYM" when linking !! Any special option I need to add to the link to work ?&lt;BR /&gt;NB: I can call the same routine from C code without any issue. Also tried to have C function as an intermediate call (between C++ and Fortran) but I'm having the same Link issue.</description>
      <pubDate>Tue, 23 Dec 2008 16:26:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-call-fortran-routine-from-c-code/m-p/4328114#M45007</guid>
      <dc:creator>Abdelali</dc:creator>
      <dc:date>2008-12-23T16:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to call Fortran routine from C++ code ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-call-fortran-routine-from-c-code/m-p/4328115#M45008</link>
      <description>&lt;!--!*#--&gt;Do I understand this correctly?  You're&lt;BR /&gt;hiding all the code, you're hiding the&lt;BR /&gt;compile and link commands, and you're hiding&lt;BR /&gt;almost all of the error message(s), and you&lt;BR /&gt;expect a useful answer?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; NB: I can call the same routine from C [...]&lt;BR /&gt;&lt;BR /&gt;Ever look at the system header files and see&lt;BR /&gt;things like this?:&lt;BR /&gt;&lt;BR /&gt;[...]&lt;BR /&gt;#ifdef __cplusplus&lt;BR /&gt;    extern "C" {&lt;BR /&gt;#endif&lt;BR /&gt;[...]&lt;BR /&gt;#ifdef __cplusplus&lt;BR /&gt;    }&lt;BR /&gt;#endif&lt;BR /&gt;[...]&lt;BR /&gt;&lt;BR /&gt;I'm not a C++ expert, but I believe that&lt;BR /&gt;those things are in there for a reason.  (And&lt;BR /&gt;it's related to those funny names.)</description>
      <pubDate>Tue, 23 Dec 2008 16:56:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-call-fortran-routine-from-c-code/m-p/4328115#M45008</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-12-23T16:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to call Fortran routine from C++ code ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-call-fortran-routine-from-c-code/m-p/4328116#M45009</link>
      <description>Abdelali,&lt;BR /&gt;&lt;BR /&gt;The complex external name is caused by "name mangling". Somewhat simplified, name mangling encodes the parameter list type information and the external name.&lt;BR /&gt;&lt;BR /&gt;I do not have the time to check Steve's syntax, but the approach is correct, having constructed cross-language calls to/fro C++ many times.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Tue, 23 Dec 2008 18:59:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-call-fortran-routine-from-c-code/m-p/4328116#M45009</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2008-12-23T18:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to call Fortran routine from C++ code ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-call-fortran-routine-from-c-code/m-p/4328117#M45010</link>
      <description>Thank you Steven &amp;amp; Bob ... Adding the define __cplusplus solved my problem.</description>
      <pubDate>Tue, 23 Dec 2008 19:16:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-call-fortran-routine-from-c-code/m-p/4328117#M45010</guid>
      <dc:creator>Abdelali</dc:creator>
      <dc:date>2008-12-23T19:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to call Fortran routine from C++ code ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-call-fortran-routine-from-c-code/m-p/4328118#M45011</link>
      <description>&amp;gt;Adding the define __cplusplus solved my problem.&lt;BR /&gt;&lt;BR /&gt;The define should automatically be added by the compiler.  And if your header is always used by C++, you don't need that #ifdef, just create an extern "C" block.&lt;BR /&gt;&lt;BR /&gt;Unfortunately there is no: extern "fortran" :-)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Robert: I do not have the time to check Steve's syntax&lt;BR /&gt;&lt;BR /&gt;The syntax is correct for a file that is shared between C and C++.</description>
      <pubDate>Wed, 24 Dec 2008 03:00:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-call-fortran-routine-from-c-code/m-p/4328118#M45011</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-12-24T03:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to call Fortran routine from C++ code ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-call-fortran-routine-from-c-code/m-p/4328119#M45012</link>
      <description>&lt;!--!*#--&gt;&amp;gt; Adding the define __cplusplus solved my&lt;BR /&gt;&amp;gt; problem.&lt;BR /&gt;&lt;BR /&gt;I assume that adding the&lt;BR /&gt;      extern "C" {[...]}&lt;BR /&gt;part is what made the difference.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The define should automatically be added by&lt;BR /&gt;&amp;gt; the compiler. [...]&lt;BR /&gt;&lt;BR /&gt;You seem to assume that the solution report&lt;BR /&gt;was somehow connected with reality.  Ha!&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The syntax is correct [...]&lt;BR /&gt;&lt;BR /&gt;I expect correctness when I steal from&lt;BR /&gt;&lt;STDIO.H&gt;&lt;BR /&gt;(SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF]STDIO.H).&lt;/STDIO.H&gt;</description>
      <pubDate>Wed, 24 Dec 2008 04:17:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-call-fortran-routine-from-c-code/m-p/4328119#M45012</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-12-24T04:17:46Z</dc:date>
    </item>
  </channel>
</rss>

