<?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 Thanks in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-language-problem/m-p/784120#M29201</link>
    <description>&lt;DIV&gt;__cdecl worked fine&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Bob Rimmer&lt;/DIV&gt;</description>
    <pubDate>Tue, 30 May 2006 20:27:36 GMT</pubDate>
    <dc:creator>rrimmer</dc:creator>
    <dc:date>2006-05-30T20:27:36Z</dc:date>
    <item>
      <title>Mixed language problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-language-problem/m-p/784118#M29199</link>
      <description>&lt;DIV&gt;I am using an evaluation license and am very new to Fortran. I am trying to complie a large Fortran program to use in Mathematica via MathLink so I need to be able to access the Fortran code from C. I can build a DLL file but cannot get it to link. Here is the error:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="1"&gt;&lt;P&gt;1&amp;gt;Linking...&lt;/P&gt;&lt;P&gt;1&amp;gt;mkspline.obj : error LNK2001: unresolved external symbol _R8MKSPLINE@36&lt;/P&gt;&lt;P&gt;1&amp;gt;C:MathLinkPSplineMLReleasePSplineML.exe : fatal error LNK1120: 1 unresolved externals&lt;/P&gt;&lt;P&gt;Here is how the Fortran file is set up:&lt;/P&gt;&lt;FONT size="2"&gt;&lt;P&gt;subroutine r8mkspline(x,nx,fspl,ibcxmin,bcxmin,ibcxmax,bcxmax,&lt;/P&gt;&lt;P&gt;&amp;gt;ilinx,ier)&lt;/P&gt;&lt;P&gt;!DEC$ ATTRIBUTES DLLEXPORT :: R8MKSPLINE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and reading the .lib file with WordPad it looks like this at the end:&lt;/P&gt;&lt;FONT size="2"&gt;&lt;P&gt;&amp;#0;_R8MKSPLINE&amp;#0;pspline.dll&amp;#0;&lt;/P&gt;&lt;P&gt;I am trying to reference it in C like this:&lt;/P&gt;&lt;FONT size="2" color="#0000ff"&gt;&lt;P&gt;void&lt;FONT size="2"&gt; &lt;/FONT&gt;&lt;FONT size="2" color="#0000ff"&gt;_stdcall&lt;/FONT&gt;&lt;FONT size="2"&gt; R8MKSPLINE(&lt;/FONT&gt;&lt;FONT size="2" color="#0000ff"&gt;double&lt;/FONT&gt;&lt;FONT size="2"&gt; *x, &lt;/FONT&gt;&lt;FONT size="2" color="#0000ff"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; *nx, &lt;/FONT&gt;&lt;FONT size="2" color="#0000ff"&gt;double&lt;/FONT&gt;&lt;FONT size="2"&gt; *fspl, &lt;/FONT&gt;&lt;FONT size="2" color="#0000ff"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; *ibcxmin, &lt;/FONT&gt;&lt;FONT size="2" color="#0000ff"&gt;double&lt;/FONT&gt;&lt;FONT size="2"&gt; *bcxmin, &lt;/FONT&gt;&lt;FONT size="2" color="#0000ff"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; *ibcxmax, &lt;/FONT&gt;&lt;FONT size="2" color="#0000ff"&gt;double&lt;/FONT&gt;&lt;FONT size="2"&gt; *bcxmax, &lt;/FONT&gt;&lt;FONT size="2" color="#0000ff"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; *ilinx, &lt;/FONT&gt;&lt;FONT size="2" color="#0000ff"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; *ier);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;What else do I need to do. I feel that I am almost there this is the last error left, of course, it will probably be a miracle if it works in MathLink&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Bob Rimmer&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;P.S. I couldn't seem to make it work as a static library, probably because the program makes a lot of write calls to the console. I can eventually get rid of these, but I would like to see something work before I edit 163 files.&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 30 May 2006 09:56:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-language-problem/m-p/784118#M29199</guid>
      <dc:creator>rrimmer</dc:creator>
      <dc:date>2006-05-30T09:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed language problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-language-problem/m-p/784119#M29200</link>
      <description>In Intel Fortran, the default calling convention was changed from CVF's __stdcall to __cdecl. That means that you should change that on C side.&lt;BR /&gt;&lt;BR /&gt;If you instead need __stdcall for compatibility with other stuff, you can specify it on Fortran side like:&lt;BR /&gt;&lt;BR /&gt;!DEC$ATTRIBUTES DLLEXPORT, STDCALL, DECORATE, ALIAS: "R8MKSPLINE":: R8MKSPLINE&lt;BR /&gt;&lt;BR /&gt;That will give you "_R8MKSPLINE@36" instead of "_R8MKSPLINE".&lt;BR /&gt;&lt;BR /&gt;Tip: there are two better tools for the job than Notepad. One is dumpbin.exe, used from command line like:&lt;BR /&gt;&lt;BR /&gt;dumpbin /exports dllname.dll &amp;gt; temp.txt&lt;BR /&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;BR /&gt;dumpbin /symbols libname.lib &amp;gt; temp.txt&lt;BR /&gt;&lt;BR /&gt;that will give you list of exact dll's exports and list of library's routines in file temp.txt.&lt;BR /&gt;&lt;BR /&gt;The other is &lt;A href="http://www.dependencywalker.com/" target="_blank"&gt;Dependency Walker&lt;/A&gt;, with nice GUI interface.</description>
      <pubDate>Tue, 30 May 2006 14:35:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-language-problem/m-p/784119#M29200</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2006-05-30T14:35:06Z</dc:date>
    </item>
    <item>
      <title>Thanks</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-language-problem/m-p/784120#M29201</link>
      <description>&lt;DIV&gt;__cdecl worked fine&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Bob Rimmer&lt;/DIV&gt;</description>
      <pubDate>Tue, 30 May 2006 20:27:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-language-problem/m-p/784120#M29201</guid>
      <dc:creator>rrimmer</dc:creator>
      <dc:date>2006-05-30T20:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Thanks</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-language-problem/m-p/784121#M29202</link>
      <description>&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;Dear all,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;I'm working with a combined VB6 - F90 code using F90 dll connected to the VB6 interface and I have some problems related to the data exchange between Visual Basic and Fortran, especially using user data type. &lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;Please consider, for example, a structured user data type as the following:&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;Type datacurve&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;vector1 (1 to n) as double&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;End type&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Jun 2006 15:57:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-language-problem/m-p/784121#M29202</guid>
      <dc:creator>paolo_becchi</dc:creator>
      <dc:date>2006-06-12T15:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Thanks</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-language-problem/m-p/784122#M29203</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;Dear all,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;I'm working with a combined VB6 - F90 code using F90 dll connected to the VB6 interface and I have some problems related to the data exchange between Visual Basic and Fortran, especially using user data type. &lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;Please consider, for example, a structured user data type as the following:&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;Type datacurve&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;vector1 (1 to n) as double&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;matrix (1 to m, 1 to p) as single&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;....&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;End type&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;I have no problem if I have to exchange this kind of data between VB6 and F90 and back especially if the data type is already dimensioned. &lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;But if I would like to read the data from a file using a F90 dll, I should have to allocate the datatype in F90 dll code pass it back to VB6, but I have problems related to the dimensions. So, at the moment, in order to avoid this problem, I call a pre-reading F90 subroutine that read the dimensional parameter (n, m, p and so on), comes back to the VB6 where the data type is dimensioned and then this data is exchanged again to the F90 dll code where the file is read and the user data type variables is stored.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;Has somebody a better solution for this kind of problems. &lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633cc"&gt;Thank you very much for your contributions&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Jun 2006 16:04:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-language-problem/m-p/784122#M29203</guid>
      <dc:creator>paolo_becchi</dc:creator>
      <dc:date>2006-06-12T16:04:19Z</dc:date>
    </item>
  </channel>
</rss>

