<?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: DLL export naming confusion... in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/DLL-export-naming-confusion/m-p/845480#M63449</link>
    <description>!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:"usersub" :: usersub&lt;BR /&gt;&lt;BR /&gt;The Microsoft tools sometimes hide the leading underscore.  I agree it is frustrating.</description>
    <pubDate>Tue, 24 Jan 2006 22:37:10 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2006-01-24T22:37:10Z</dc:date>
    <item>
      <title>DLL export naming confusion...</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/DLL-export-naming-confusion/m-p/845479#M63448</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I use CFV 6.6c. In order for a third-party application to access an application of mine written in FORTRAN, I must supply it in the form of a DLL containing a subroutine with an exported lower case name 'usersub'. That is the routine that the third-party app. looks for (I think it is C-based).The standard compiler directive DLLEXPORT produces a DLL with 2 exports for a subroutine named USERSUB. These are USERSUB and&lt;A href="mailto:_USERSUB@8" target="_blank"&gt;_USERSUB@8&lt;/A&gt; (The subroutine takes two arguments). When building the DLL, I have to include a Third-party .OBJ containing routines that it requires to be present, one of whose names (cvsetupprocedure) is exported using '/export: cvsetupprocedure' added to the project's linker step. I would like to know two things&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;1) How can I achieve a lower-case exported name 'usersub' using compiler directives? (I achieved this by using /export:usersub=_USERSUB@8 as a linker stage addition, but am not sure why it worked!)&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;2) Why does the listing produced by DUMPBIN /SYMBOLS carried out seperately on the Dynamic-link library's .DLL and .LIB files produce names which sometimes differ by a leading underscore? I include sample listing below.(p.s., for some reason, when I type_&lt;A href="mailto:USERSUB@8" target="_blank"&gt;USERSUB@8&lt;/A&gt; itis almost always automatically underlined in the above text, when it should only have a leading underscore!)&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;C:F90DF
ewbeamsUSERSUBRelease&amp;gt;DUMPBIN USERSUB.lib /EXPORTS&lt;BR /&gt;Microsoft  COFF Binary File Dumper Version 6.00.8447&lt;BR /&gt;Copyright (C) Microsoft Corp 1992-1998. All rights reserved.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;Dump of file USERSUB.lib&lt;/DIV&gt;
&lt;DIV&gt;File Type: LIBRARY&lt;/DIV&gt;
&lt;DIV&gt;Exports&lt;/DIV&gt;
&lt;DIV&gt;ordinal name&lt;/DIV&gt;
&lt;DIV&gt;&lt;A href="mailto:_USERSUB@8" target="_blank"&gt;_USERSUB@8&lt;/A&gt;&lt;BR /&gt; _cvsetupprocedure&lt;BR /&gt;usersub&lt;/DIV&gt;
&lt;DIV&gt;Summary&lt;/DIV&gt;
&lt;DIV&gt;C6 .debug$S&lt;BR /&gt;14 .idata$2&lt;BR /&gt;14 .idata$3&lt;BR /&gt;4 .idata$4&lt;BR /&gt;4 .idata$5&lt;BR /&gt;C .idata$6&lt;/DIV&gt;
&lt;DIV&gt;C:F90DF
ewbeamsUSERSUBRelease&amp;gt;DUMPBIN USERSUB.DLL /EXPORTS&lt;BR /&gt;Microsoft  COFF Binary File Dumper Version 6.00.8447&lt;BR /&gt;Copyright (C) Microsoft Corp 1992-1998. All rights reserved.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;Dump of file USERSUB.DLL&lt;/DIV&gt;
&lt;DIV&gt;File Type: DLL&lt;/DIV&gt;
&lt;DIV&gt;Section contains the following exports for usersub.dll&lt;/DIV&gt;
&lt;DIV&gt;0 characteristics&lt;BR /&gt;43D608CF time date stamp Tue Jan 24 11:00:31 2006&lt;BR /&gt;0.00 version&lt;BR /&gt;1 ordinal base&lt;BR /&gt;3 number of functions&lt;BR /&gt;3 number of names&lt;/DIV&gt;
&lt;DIV&gt;ordinal hint RVA name&lt;/DIV&gt;
&lt;DIV&gt;1 0 00001000 &lt;A href="mailto:_USERSUB@8" target="_blank"&gt;_USERSUB@8&lt;/A&gt;&lt;BR /&gt; 2 1 00001020 cvsetupprocedure&lt;BR /&gt;3 2 00001000 usersub&lt;/DIV&gt;
&lt;DIV&gt;Summary&lt;/DIV&gt;
&lt;DIV&gt;1000 .data&lt;BR /&gt;1000 .rdata&lt;BR /&gt;1000 .reloc&lt;BR /&gt;1000 .text&lt;BR /&gt;1000 .trace&lt;/DIV&gt;
&lt;DIV&gt;C:F90DF
ewbeamsUSERSUBRelease&amp;gt;&lt;/DIV&gt;
&lt;P&gt;Message Edited by anthonyrichards on &lt;SPAN class="date_text"&gt;01-24-2006&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;04:28 AM&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Message Edited by anthonyrichards on &lt;SPAN class="date_text"&gt;01-24-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;04:29 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by anthonyrichards on &lt;SPAN class="date_text"&gt;01-24-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;04:30 AM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2006 20:25:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/DLL-export-naming-confusion/m-p/845479#M63448</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2006-01-24T20:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: DLL export naming confusion...</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/DLL-export-naming-confusion/m-p/845480#M63449</link>
      <description>!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:"usersub" :: usersub&lt;BR /&gt;&lt;BR /&gt;The Microsoft tools sometimes hide the leading underscore.  I agree it is frustrating.</description>
      <pubDate>Tue, 24 Jan 2006 22:37:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/DLL-export-naming-confusion/m-p/845480#M63449</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2006-01-24T22:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: DLL export naming confusion...</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/DLL-export-naming-confusion/m-p/845481#M63450</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks, Steve. After finally getting my application to start with a call to my DLL containing the exported symbol 'usersub' from the third-party app., I found that when I finally exited from my application by returning from the 'usersub' routine, the third party app. crashed with an access error. After various attempts at 'voodoo' to solve the problem(!!), Igot the feeling that this might be due to C/Fortran stack handling problems, so I played around with !DEC$ directives until I hit on one that worked and the third party app. stopped crashing on return from my app. Here is what I found worked:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;!DEC$ ATTRIBUTES REFERENCE, C :: USERSUB&lt;BR /&gt;!DEC$ ATTRIBUTES DLLEXPORT :: USERSUB&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;Abonus is that this appears to automatically produce a lower-case exported name in the DLL that isproduced.&lt;/DIV&gt;</description>
      <pubDate>Wed, 25 Jan 2006 00:25:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/DLL-export-naming-confusion/m-p/845481#M63450</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2006-01-25T00:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: DLL export naming confusion...</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/DLL-export-naming-confusion/m-p/845482#M63451</link>
      <description>Yup - if the calling application expects the C calling interface, your solution is good.  I recommend adding the alias anyway as CVF is supposed to be adding an underscore.  I've seen some situations where it doesn't.</description>
      <pubDate>Wed, 25 Jan 2006 01:02:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/DLL-export-naming-confusion/m-p/845482#M63451</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2006-01-25T01:02:06Z</dc:date>
    </item>
  </channel>
</rss>

