<?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 DLLEXPORT overloaded interface. in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/DLLEXPORT-overloaded-interface/m-p/799545#M37037</link>
    <description>Hello!&lt;BR /&gt;&lt;BR /&gt;In a DLL I have code that performs real and complex number addition.&lt;BR /&gt;I put the two subroutines (real and complex addition) in a module and overloaded the interface.&lt;BR /&gt;The problem is that I want to export only one routine, i.e. the overloaded interface.&lt;BR /&gt;&lt;BR /&gt;I included the code below:&lt;BR /&gt;&lt;PRE&gt;moduleoutput
implicitnone
private

public::add
 
 
!dec$attributesdllexport,c,reference,alias:'add'::add
interfaceadd
moduleprocedureradd,cadd
endinterfaceadd

contains
 
subroutineradd(a,b,x)
implicitnone

real,intent(in)::a,b
real,intent(out)::x

x=a+b

endsubroutineradd
 
subroutinecadd(a,b,x)
implicitnone

complex,intent(in)::a,b
complex,intent(out)::x

x=a+b

endsubroutinecadd

endmoduleoutput
&lt;/PRE&gt;&lt;BR /&gt;How do I export the overloaded interface "add"?&lt;BR /&gt;&lt;BR /&gt;Thank you for your suggestions.</description>
    <pubDate>Mon, 18 Jun 2012 16:53:21 GMT</pubDate>
    <dc:creator>Ilie__Daniel</dc:creator>
    <dc:date>2012-06-18T16:53:21Z</dc:date>
    <item>
      <title>DLLEXPORT overloaded interface.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/DLLEXPORT-overloaded-interface/m-p/799545#M37037</link>
      <description>Hello!&lt;BR /&gt;&lt;BR /&gt;In a DLL I have code that performs real and complex number addition.&lt;BR /&gt;I put the two subroutines (real and complex addition) in a module and overloaded the interface.&lt;BR /&gt;The problem is that I want to export only one routine, i.e. the overloaded interface.&lt;BR /&gt;&lt;BR /&gt;I included the code below:&lt;BR /&gt;&lt;PRE&gt;moduleoutput
implicitnone
private

public::add
 
 
!dec$attributesdllexport,c,reference,alias:'add'::add
interfaceadd
moduleprocedureradd,cadd
endinterfaceadd

contains
 
subroutineradd(a,b,x)
implicitnone

real,intent(in)::a,b
real,intent(out)::x

x=a+b

endsubroutineradd
 
subroutinecadd(a,b,x)
implicitnone

complex,intent(in)::a,b
complex,intent(out)::x

x=a+b

endsubroutinecadd

endmoduleoutput
&lt;/PRE&gt;&lt;BR /&gt;How do I export the overloaded interface "add"?&lt;BR /&gt;&lt;BR /&gt;Thank you for your suggestions.</description>
      <pubDate>Mon, 18 Jun 2012 16:53:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/DLLEXPORT-overloaded-interface/m-p/799545#M37037</guid>
      <dc:creator>Ilie__Daniel</dc:creator>
      <dc:date>2012-06-18T16:53:21Z</dc:date>
    </item>
    <item>
      <title>DLLEXPORT overloaded interface.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/DLLEXPORT-overloaded-interface/m-p/799546#M37038</link>
      <description>You don't - that's not how it works. Your module makes "add" the only public symbol for users of the module. But you must export from the DLL all of the specific routines that "add" can resolve to. "add" is not a callable routine, it's a generic interface that the compiler sorts out.</description>
      <pubDate>Mon, 18 Jun 2012 17:14:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/DLLEXPORT-overloaded-interface/m-p/799546#M37038</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-06-18T17:14:09Z</dc:date>
    </item>
    <item>
      <title>DLLEXPORT overloaded interface.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/DLLEXPORT-overloaded-interface/m-p/799547#M37039</link>
      <description>Ok. Thank you Steve.&lt;BR /&gt;I exported each routine individually and added this to the main program:&lt;BR /&gt;&lt;PRE&gt;interfaceadd
subroutineradd(a,b,x)
!dec$attributesdllimport,c,reference,alias:'radd'::radd
!dec$attributesreference::a,b,x
implicitnone

real,intent(in)::a,b
real,intent(out)::x
endsubroutineradd
 
subroutinecadd(a,b,x)
!dec$attributesdllimport,c,reference,alias:'cadd'::cadd
!dec$attributesreference::a,b,x
implicitnone

complex,intent(in)::a,b
complex,intent(out)::x
endsubroutinecadd
endinterfaceadd
&lt;/PRE&gt;&lt;BR /&gt;Everything works fine now.</description>
      <pubDate>Tue, 19 Jun 2012 14:34:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/DLLEXPORT-overloaded-interface/m-p/799547#M37039</guid>
      <dc:creator>Ilie__Daniel</dc:creator>
      <dc:date>2012-06-19T14:34:05Z</dc:date>
    </item>
    <item>
      <title>DLLEXPORT overloaded interface.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/DLLEXPORT-overloaded-interface/m-p/799548#M37040</link>
      <description>If you used a module for your routines, just USE the module in the main program. You should never have to repeat the interface. The DLLEXPORTs will magically turn into DLLIMPORTs on the USE.</description>
      <pubDate>Tue, 19 Jun 2012 14:59:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/DLLEXPORT-overloaded-interface/m-p/799548#M37040</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-06-19T14:59:40Z</dc:date>
    </item>
    <item>
      <title>DLLEXPORT overloaded interface.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/DLLEXPORT-overloaded-interface/m-p/799549#M37041</link>
      <description>Ok, but this works only if I include the path to the compiled module file (output.mod). This is in addition to referencing the .lib in the main program, which I did before anyway.</description>
      <pubDate>Tue, 19 Jun 2012 15:29:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/DLLEXPORT-overloaded-interface/m-p/799549#M37041</guid>
      <dc:creator>Ilie__Daniel</dc:creator>
      <dc:date>2012-06-19T15:29:00Z</dc:date>
    </item>
    <item>
      <title>DLLEXPORT overloaded interface.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/DLLEXPORT-overloaded-interface/m-p/799550#M37042</link>
      <description>Yes - typically you would provide the LIB and MOD to the user of your code. If you make the library project a dependent of the main project, the compiler will see the .mod file from the library automatically (that is new in Composer XE 2011).</description>
      <pubDate>Tue, 19 Jun 2012 15:50:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/DLLEXPORT-overloaded-interface/m-p/799550#M37042</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-06-19T15:50:25Z</dc:date>
    </item>
  </channel>
</rss>

