<?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 They are not stopped from in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129109#M133750</link>
    <description>&lt;P&gt;They are not stopped from calling the code in the DLL, they just don't have a name for the entry point.&lt;/P&gt;

&lt;P&gt;Ordinals are a hangover from 16 bit days when bytes mattered. Named exports are easier to maintain.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 May 2018 05:21:56 GMT</pubDate>
    <dc:creator>IanH</dc:creator>
    <dc:date>2018-05-25T05:21:56Z</dc:date>
    <item>
      <title>Exporting subroutines from a Fortran DLL</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129099#M133740</link>
      <description>&lt;P&gt;In a DLL project, we export all our subroutines and functions (which are normally in modules) using:&lt;/P&gt;

&lt;P&gt;!dec$ attributes dllexport :: routine_name&lt;/P&gt;

&lt;P&gt;in the appropriate place in the files.&lt;/P&gt;

&lt;P&gt;I now want to add some external code which I'd rather not edit (as it will get overwritten every time I get new versions), so I created a DEF file containing:&lt;/P&gt;

&lt;P&gt;EXPORTS&lt;BR /&gt;
	new_routine1 @1&lt;BR /&gt;
	new_routine2 @2&lt;/P&gt;

&lt;P&gt;Then I included this file in the DLL project and rebuilt.&amp;nbsp; However when I look in the DLL using DEPENDS, these functions are not exported.&lt;/P&gt;

&lt;P&gt;Not sure what I am doing wrong.&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 21:33:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129099#M133740</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2018-05-23T21:33:50Z</dc:date>
    </item>
    <item>
      <title>Is there a particular reason</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129100#M133741</link>
      <description>&lt;P&gt;Is there a particular reason that you are exporting by ordinal?&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 23:53:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129100#M133741</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2018-05-23T23:53:39Z</dc:date>
    </item>
    <item>
      <title>I thought that was the syntax</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129101#M133742</link>
      <description>&lt;P&gt;I thought that was the syntax.&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 00:09:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129101#M133742</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2018-05-24T00:09:50Z</dc:date>
    </item>
    <item>
      <title>It is very likely that you</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129102#M133743</link>
      <description>&lt;P&gt;It is very likely that you don't need to specify the ordinal (you would only need it if procedures in the DLL were being referenced by that ordinal - rare for user code) - you can just list the name of the procedure to be exported.&lt;/P&gt;

&lt;P&gt;But some experimentation here shows that it doesn't appear to prevent the symbol being exported by name anyway.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;! apple.f90
SUBROUTINE apple() BIND(C, NAME='apple')
  IMPLICIT NONE
END SUBROUTINE apple
&lt;/PRE&gt;

&lt;PRE class="brush:fortran;"&gt;! banana.f90
MODULE m
  IMPLICIT NONE
CONTAINS
  SUBROUTINE banana
    !DEC$ ATTRIBUTES DLLEXPORT :: banana
  END SUBROUTINE banana
END MODULE m
&lt;/PRE&gt;

&lt;PRE class="brush:plain;"&gt;; dll.def
EXPORTS
  apple @1
&lt;/PRE&gt;

&lt;PRE class="brush:plain;"&gt;&amp;gt;ifort /dll "2018-05-24 apple.f90" "2018-05-24 banana.f90" "2018-05-24 dll.def" /exe:"2018-05-24 dll.dll"
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.2.185 Build 20180210
Copyright (C) 1985-2018 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.

"-out:2018-05-24 dll.dll"
-dll
"-implib:2018-05-24 dll.lib"
"-def:2018-05-24 dll.def"
"2018-05-24 apple.obj"
"2018-05-24 banana.obj"
   Creating library 2018-05-24 dll.lib and object 2018-05-24 dll.exp

&amp;gt;dumpbin /exports "2018-05-24 dll.dll"
Microsoft (R) COFF/PE Dumper Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file 2018-05-24 dll.dll

File Type: DLL

  Section contains the following exports for 2018-05-24 dll.dll

    00000000 characteristics
    5B069BD9 time date stamp Thu May 24 20:32:49 2018
        0.00 version
           1 ordinal base
           2 number of functions
           2 number of names

    ordinal hint RVA      name

          2    0 00001020 M_mp_BANANA
          1    1 00001000 apple
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 11:03:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129102#M133743</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2018-05-24T11:03:37Z</dc:date>
    </item>
    <item>
      <title>I removed the ordinals,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129103#M133744</link>
      <description>&lt;P&gt;I removed the ordinals, rebuilt the project, but the routines in the DEF file do not appear in the dumpbin.&amp;nbsp; Only the ones which have explicit "!dec$ attributes dllexport ::&amp;nbsp;" appear.&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 14:32:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129103#M133744</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2018-05-24T14:32:08Z</dc:date>
    </item>
    <item>
      <title>I see the problem.  When I</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129104#M133745</link>
      <description>&lt;P&gt;I see the problem.&amp;nbsp; When I simply add the DEF file to the project in VS (like I add a F90 file) it does not add it to the LINK command line as you have manually done in your example.&amp;nbsp; I have to physically specify it as a "Module Definition File".&amp;nbsp; Then it adds it to the LINK command line as /DEF:file.def which works.&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 14:55:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129104#M133745</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2018-05-24T14:55:17Z</dc:date>
    </item>
    <item>
      <title>Another thing, I thought that</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129105#M133746</link>
      <description>&lt;P&gt;Another thing, I thought that adding NONAME to the end of the file in the DEF file prevented the name from appearing in the DLL, however dumpbin still shows it as there.&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 19:28:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129105#M133746</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2018-05-24T19:28:47Z</dc:date>
    </item>
    <item>
      <title>With the def file from above</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129106#M133747</link>
      <description>&lt;P&gt;With the def file from above changed to:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;; dll.def
EXPORTS
  apple @1 NONAME
&lt;/PRE&gt;

&lt;P&gt;if I relink I see the exports as:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;&amp;gt;dumpbin /exports "2018-05-24 dll.dll"
...
  Section contains the following exports for 2018-05-24 dll.dll

    00000000 characteristics
    5B07198A time date stamp Fri May 25 05:29:06 2018
        0.00 version
           1 ordinal base
           2 number of functions
           1 number of names

    ordinal hint RVA      name

          2    0 00001020 M_mp_BANANA
          1      00001000 [NONAME]&lt;/PRE&gt;

&lt;P&gt;But I don't recommend excluding the names and/or linking by ordinal.&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 20:05:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129106#M133747</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2018-05-24T20:05:00Z</dc:date>
    </item>
    <item>
      <title>Ah yes I see that in Release</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129107#M133748</link>
      <description>&lt;P&gt;Ah yes I see that in Release mode.&amp;nbsp; In Debug mode it still lists the Export name.&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 20:16:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129107#M133748</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2018-05-24T20:16:37Z</dc:date>
    </item>
    <item>
      <title>Why do you not recommend</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129108#M133749</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;Why do you not recommend excluding the names and/or linking by ordinal ?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;Say for example you are distributing a product where your code exists in 1 exe and number of DLL's and you and you only want to call that DLL from your code.&amp;nbsp; Hiding that name would prevent someone else from using your DLL for their own purposes.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 01:52:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129108#M133749</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2018-05-25T01:52:27Z</dc:date>
    </item>
    <item>
      <title>They are not stopped from</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129109#M133750</link>
      <description>&lt;P&gt;They are not stopped from calling the code in the DLL, they just don't have a name for the entry point.&lt;/P&gt;

&lt;P&gt;Ordinals are a hangover from 16 bit days when bytes mattered. Named exports are easier to maintain.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 05:21:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129109#M133750</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2018-05-25T05:21:56Z</dc:date>
    </item>
    <item>
      <title>sorry for interrupting the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129110#M133751</link>
      <description>&lt;P&gt;sorry for interrupting the topic: i have a related problem &lt;A href="https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/779404"&gt;here&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;can someone give me a hint on that?&lt;/P&gt;

&lt;P&gt;thanks a lot&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 12:28:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Exporting-subroutines-from-a-Fortran-DLL/m-p/1129110#M133751</guid>
      <dc:creator>Pietro_P_</dc:creator>
      <dc:date>2018-05-25T12:28:59Z</dc:date>
    </item>
  </channel>
</rss>

