<?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 Quote:tkibedi wrote: in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155226#M141351</link>
    <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;tkibedi wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I forget to add, that inserting the&amp;nbsp;&lt;/P&gt;&lt;P&gt;!DEC$ ATTRIBUTES CVF :: INTERP&lt;/P&gt;&lt;P&gt;did not solve the problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tibor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you get past the linking error, you can take a closer look at your code: did you mean to declare the 'SolutionFile' as a scalar variable in line 17 with a default length which is 1?&lt;/P&gt;&lt;P&gt;By the way, from a portability viewpoint&amp;nbsp;for interoperable code, you may want to use the defined kinds in 'ISO_C_BINDING' intrinsic module of c_int and c_double rather than hard-wired ones of 4, 8 which don't have the same meaning on different compilers.&amp;nbsp; Also, you may want to consider the BLOCK with EXIT construct (https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-block) which is preferable to DO intended to used as one-pass.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Sep 2019 03:19:33 GMT</pubDate>
    <dc:creator>FortranFan</dc:creator>
    <dc:date>2019-09-03T03:19:33Z</dc:date>
    <item>
      <title>LNK2019 error - Fortran calling C++ library</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155221#M141346</link>
      <description>&lt;P&gt;I try to link an&amp;nbsp;old Fortran legacy code with a C++ library, developed for CVF6.6. Using the mixed language sample to call C++ library from Fortran, I modified the interface declaration, but I could not resolve the LNK2019 error. I attach the Fortran source, the lib and dll file obtained as part of the Poisson Superfish package.&lt;/P&gt;&lt;P&gt;Unfortunately I do not have the source code for the C++ library.&amp;nbsp;Any help would be appreciated to resolve the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 14:37:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155221#M141346</guid>
      <dc:creator>tkibedi</dc:creator>
      <dc:date>2019-09-02T14:37:57Z</dc:date>
    </item>
    <item>
      <title>It always helps, when asking</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155222#M141347</link>
      <description>&lt;P&gt;It always helps, when asking for help on an error, to show the exact and complete text of the error, rather than just referring to it by number. None of us have memorized all the error numbers, and LNK2019 is extremely generic.&lt;/P&gt;&lt;P&gt;The library assumes CVF calling convention, which is STDCALL. The simplest way to deal with this is to add the line:&lt;/P&gt;&lt;P&gt;!DEC$ ATTRIBUTES CVF :: INTERP&lt;/P&gt;&lt;P&gt;after the IMPORT line in your interface for INTERP. (I assume you are using a reasonably current version of Intel Fortran. If you're using one from 2011 or so, I don't want to hear about it.)&lt;/P&gt;&lt;P&gt;If this doesn't resolve the issue, please ZIP the buildlog.htm and attach that to a reply here.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 16:28:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155222#M141347</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2019-09-02T16:28:14Z</dc:date>
    </item>
    <item>
      <title>Thanks Steve. I am using the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155223#M141348</link>
      <description>&lt;P&gt;Thanks Steve. I am using the VS2015 and the latest Intel Fortran Compiler (19.0.4.228). Attached is the bulldog.htm file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tibor&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 18:53:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155223#M141348</guid>
      <dc:creator>tkibedi</dc:creator>
      <dc:date>2019-09-02T18:53:49Z</dc:date>
    </item>
    <item>
      <title>I forget to add, that</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155224#M141349</link>
      <description>&lt;P&gt;I forget to add, that inserting the&amp;nbsp;&lt;/P&gt;&lt;P&gt;!DEC$ ATTRIBUTES CVF :: INTERP&lt;/P&gt;&lt;P&gt;did not solve the problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tibor&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 19:14:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155224#M141349</guid>
      <dc:creator>tkibedi</dc:creator>
      <dc:date>2019-09-02T19:14:57Z</dc:date>
    </item>
    <item>
      <title>Oh, I missed that you had</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155225#M141350</link>
      <description>&lt;P&gt;Oh, I missed that you had BIND(C) at the end of the declaration of INTERP. Try this:&lt;/P&gt;
&lt;PRE class="brush:fortran; class-name:dark;"&gt;  Interface
    Integer(kind=4) function INTERP(SolutionFile, Xvalue, Yvalue, Solution, Xcomponent, Ycomponent, DBYDY, DBYDX, DBXDY)  bind(C,NAME="INTERP")
    IMPORT ! Use declarations from host
!DEC$ ATTRIBUTES STDCALL :: INTERP
      CHARACTER(kind=C_CHAR), Dimension(*), Intent(IN)      :: SolutionFile
      Real (kind=8),  Intent(IN)        :: Xvalue, Yvalue
      Real (Kind=8),        Intent(OUT)       :: Solution,  Xcomponent, Ycomponent
      Real (Kind=8),        Intent(OUT)       :: DBYDY, DBYDX, DBXDY
    End Function INTERP
  End Interface
&lt;/PRE&gt;

&lt;P&gt;This should link, but I note that your program doesn't NUL-terminate SolutionFile and the library is not expecting a length to be passed (9 arguments at 4 bytes each corresponds to the @36 suffix), so I am not sure how it determines the character length.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 00:19:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155225#M141350</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2019-09-03T00:19:00Z</dc:date>
    </item>
    <item>
      <title>Quote:tkibedi wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155226#M141351</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;tkibedi wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I forget to add, that inserting the&amp;nbsp;&lt;/P&gt;&lt;P&gt;!DEC$ ATTRIBUTES CVF :: INTERP&lt;/P&gt;&lt;P&gt;did not solve the problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tibor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you get past the linking error, you can take a closer look at your code: did you mean to declare the 'SolutionFile' as a scalar variable in line 17 with a default length which is 1?&lt;/P&gt;&lt;P&gt;By the way, from a portability viewpoint&amp;nbsp;for interoperable code, you may want to use the defined kinds in 'ISO_C_BINDING' intrinsic module of c_int and c_double rather than hard-wired ones of 4, 8 which don't have the same meaning on different compilers.&amp;nbsp; Also, you may want to consider the BLOCK with EXIT construct (https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-block) which is preferable to DO intended to used as one-pass.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 03:19:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155226#M141351</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2019-09-03T03:19:33Z</dc:date>
    </item>
    <item>
      <title>Thanks for the suggestions. I</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155227#M141352</link>
      <description>&lt;P&gt;Thanks for the suggestions. I compiled and linked the attached file (CVF_Interp.f90) and it works now. I used MS VS 2015 and Intel XE 2019 compiler on a Win10 machine.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 17:05:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LNK2019-error-Fortran-calling-C-library/m-p/1155227#M141352</guid>
      <dc:creator>tkibedi</dc:creator>
      <dc:date>2019-09-05T17:05:19Z</dc:date>
    </item>
  </channel>
</rss>

