<?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 Microsoft Windows [Version 10 in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132096#M134582</link>
    <description>&lt;P&gt;Microsoft Windows [Version 10.0.17134.523]&lt;BR /&gt;(c) Корпорация Майкрософт (Microsoft Corporation), 2018. Все права защищены.&lt;/P&gt;&lt;P&gt;C:\Users\bakhb_000&amp;gt;d:&lt;/P&gt;&lt;P&gt;D:\&amp;gt;cd temporaryfolder/ivfcvfforumcl&lt;/P&gt;&lt;P&gt;D:\TemporaryFolder\IVFCVFFORUMCL&amp;gt;df /compile_only modul2.f90&lt;BR /&gt;Compaq Visual Fortran Optimizing Compiler Version 6.6&lt;BR /&gt;Copyright 2001 Compaq Computer Corp. All rights reserved.&lt;/P&gt;&lt;P&gt;modul2.f90&lt;/P&gt;&lt;P&gt;D:\TemporaryFolder\IVFCVFFORUMCL&amp;gt;df /dll subro2.f90 modul2.obj&lt;BR /&gt;Compaq Visual Fortran Optimizing Compiler Version 6.6&lt;BR /&gt;Copyright 2001 Compaq Computer Corp. All rights reserved.&lt;/P&gt;&lt;P&gt;subro2.f90&lt;BR /&gt;Microsoft (R) Incremental Linker Version 6.00.8447&lt;BR /&gt;Copyright (C) Microsoft Corp 1992-1998. All rights reserved.&lt;/P&gt;&lt;P&gt;/entry:_DllMainCRTStartup@12&lt;BR /&gt;/ignore:505&lt;BR /&gt;/debugtype:cv&lt;BR /&gt;/debug:minimal&lt;BR /&gt;/pdb:none&lt;BR /&gt;C:\Users\BAKHB_~1\AppData\Local\Temp\obj7132.tmp&lt;BR /&gt;modul2.obj&lt;BR /&gt;dfordll.lib&lt;BR /&gt;msvcrt.lib&lt;BR /&gt;dfconsol.lib&lt;BR /&gt;dfport.lib&lt;BR /&gt;kernel32.lib&lt;BR /&gt;/out:subro2.dll&lt;BR /&gt;/dll&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Creating library subro2.lib and object subro2.exp&lt;BR /&gt;LINK : warning LNK4098: defaultlib "libc.lib" conflicts with use of other libs; use /NODEFAULTLIB:library&lt;/P&gt;&lt;P&gt;D:\TemporaryFolder\IVFCVFFORUMCL&amp;gt;df amain2.f90 modul2.obj subro2.lib &amp;amp; amain2&lt;BR /&gt;Compaq Visual Fortran Optimizing Compiler Version 6.6&lt;BR /&gt;Copyright 2001 Compaq Computer Corp. All rights reserved.&lt;/P&gt;&lt;P&gt;amain2.f90&lt;BR /&gt;Microsoft (R) Incremental Linker Version 6.00.8447&lt;BR /&gt;Copyright (C) Microsoft Corp 1992-1998. All rights reserved.&lt;/P&gt;&lt;P&gt;/subsystem:console&lt;BR /&gt;/entry:mainCRTStartup&lt;BR /&gt;/ignore:505&lt;BR /&gt;/debugtype:cv&lt;BR /&gt;/debug:minimal&lt;BR /&gt;/pdb:none&lt;BR /&gt;C:\Users\BAKHB_~1\AppData\Local\Temp\obj5BCC.tmp&lt;BR /&gt;modul2.obj&lt;BR /&gt;subro2.lib&lt;BR /&gt;dfor.lib&lt;BR /&gt;libc.lib&lt;BR /&gt;dfconsol.lib&lt;BR /&gt;dfport.lib&lt;BR /&gt;kernel32.lib&lt;BR /&gt;/out:amain2.exe&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Creating library amain2.lib and object amain2.exp&lt;BR /&gt;&amp;nbsp;S = &amp;nbsp; 0.000000000000000E+000&lt;/P&gt;&lt;P&gt;D:\TemporaryFolder\IVFCVFFORUMCL&amp;gt;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Jan 2019 01:52:47 GMT</pubDate>
    <dc:creator>Bakhbergen</dc:creator>
    <dc:date>2019-01-14T01:52:47Z</dc:date>
    <item>
      <title>Compaq Visual Fortran 6.6: Dynamic-Link Library (DLL) and Module</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132080#M134566</link>
      <description>&lt;P style="margin-left:0cm; margin-right:0cm"&gt;I need to create and use dynamic-link library (DLL) for Fortran application using Compaq Visual Fortran 6.6. The following code works just fine:&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROGRAM AMAIN1&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPLICIT NONE&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; REAL(8):: A,B,S&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A = 1D0&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; B = 2D0&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL SUBRO1(A,B,S)&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT*, 'S = ', S&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; END PROGRAM AMAIN1&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUBROUTINE SUBRO1(A,B,S)&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; !DEC$ ATTRIBUTES DLLEXPORT :: SUBRO1&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPLICIT NONE&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; REAL(8):: A,B,S&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; S = A + B&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETURN&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; END SUBROUTINE SUBRO1&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;The result is correct:&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; S =&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.00000000000000&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Press any key to continue&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;However, if I implement the same algorithm using the module, I get inconsistent result (i.e. zero):&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROGRAM AMAIN2&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; USE MODUL2&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A = 1D0&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; B = 2D0&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL SUBRO2&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT*, 'S = ', S&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; END PROGRAM AMAIN2&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MODULE MODUL2&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPLICIT NONE&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; REAL(8):: A,B,S&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; END MODULE MODUL2&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUBROUTINE SUBRO2&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;!DEC$ ATTRIBUTES DLLEXPORT :: SUBRO2&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; USE MODUL2&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; S = A + B&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETURN&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; END SUBROUTINE SUBRO2&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;The result is incorrect:&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; S =&amp;nbsp;&amp;nbsp; 0.000000000000000E+000&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Press any key to continue&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;As can be seen above, DLL contains only subprogram in both cases (SUBRO1 and SUBRO2, respectively). I have built DLL and LIB files from the visual development environment. The second case (with the use of module) represents the structure of my large source-code so I need to resolve this issue. Any advice would be greatly appreciated.&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;BTW, the same algorithm without using the DLL works well and gives correct result:&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROGRAM AMAIN3&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; USE MODUL3&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A = 1D0&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; B = 2D0&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL SUBRO3&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT*, 'S = ', S&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; END PROGRAM AMAIN3&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MODULE MODUL3&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPLICIT NONE&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; REAL(8):: A,B,S&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; END MODULE MODUL3&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUBROUTINE SUBRO3&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; USE MODUL3&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; S = A + B&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETURN&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; END SUBROUTINE SUBRO3&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;The result is correct:&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; S =&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.00000000000000&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Press any key to continue&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 12:50:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132080#M134566</guid>
      <dc:creator>Bakhbergen</dc:creator>
      <dc:date>2019-01-09T12:50:58Z</dc:date>
    </item>
    <item>
      <title>In the module source, set the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132081#M134567</link>
      <description>&lt;P&gt;In the module source, set the DLLEXPORT attribute for the variables A, B and S.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 00:40:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132081#M134567</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2019-01-10T00:40:13Z</dc:date>
    </item>
    <item>
      <title>This was also asked on</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132082#M134568</link>
      <description>&lt;P&gt;This was also asked on StackOverflow and I gave the same advice as mecej4, but I was told it did not work for the OP in CVF. I tested it in Intel Fortran and it worked. Since I no longer have access to CVF I could not try it there, but I'd expect it to work in CVF as well.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 14:55:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132082#M134568</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2019-01-10T14:55:50Z</dc:date>
    </item>
    <item>
      <title>I do have CVF 6.6C and I</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132083#M134569</link>
      <description>&lt;P&gt;I do have CVF 6.6C and I tested the modified program with it before posting the recommendation. It it did not work for OP, we need to be provided more details.&lt;/P&gt;&lt;P&gt;The Stackoverflow post is at&amp;nbsp;https://stackoverflow.com/questions/54015690/compaq-visual-fortran-6-6-dynamic-link-library-dll-and-module .&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 16:08:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132083#M134569</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2019-01-10T16:08:00Z</dc:date>
    </item>
    <item>
      <title>Please create, and attach to</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132084#M134570</link>
      <description>&lt;P&gt;Please create, and attach to a reply here, a ZIP of the source files and a log of the commands used to build and test the code.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 19:32:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132084#M134570</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2019-01-10T19:32:32Z</dc:date>
    </item>
    <item>
      <title>mecej4, Steve, I very much</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132085#M134571</link>
      <description>&lt;P style="margin-left:0cm; margin-right:0cm"&gt;mecej4, Steve, I very much appreciate your taking the time to respond to my question. Sorry for the delay in getting back to you. I am eager to solve this problem,&amp;nbsp;and trying to work on this despite my demanding work schedule this week. I’ll get back to you as soon as possible.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 22:06:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132085#M134571</guid>
      <dc:creator>Bakhbergen</dc:creator>
      <dc:date>2019-01-10T22:06:07Z</dc:date>
    </item>
    <item>
      <title>Here are the details. The</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132086#M134572</link>
      <description>&lt;P&gt;Here are the details. The source file from which the DLL is built, "subro.f90":&lt;/P&gt;
&lt;PRE class="brush:fortran; class-name:dark;"&gt;MODULE MODUL2
   IMPLICIT NONE
   REAL(8):: A,B,S
!DEC$ ATTRIBUTES DLLEXPORT :: A,B,S
END MODULE MODUL2

SUBROUTINE SUBRO2
  !DEC$ ATTRIBUTES DLLEXPORT :: SUBRO2
   USE MODUL2
   IMPLICIT NONE
   S = A + B
   RETURN
END SUBROUTINE SUBRO2&lt;/PRE&gt;

&lt;P&gt;Command to build the DLL and import library:&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;df /opt:0 /LD subro.f90&lt;/PRE&gt;

&lt;P&gt;OP's main program, file "amin.f90":&lt;/P&gt;

&lt;PRE class="brush:fortran; class-name:dark;"&gt;PROGRAM AMAIN2
   USE MODUL2
   implicit none
!
   A = 1D0
   B = 2D0
   CALL SUBRO2
   PRINT*, 'S = ', S
END PROGRAM AMAIN2&lt;/PRE&gt;

&lt;P&gt;Command to build and run:&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;df /opt:0 /MD amin.f90 subro.lib &amp;amp; amin&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 22:51:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132086#M134572</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2019-01-10T22:51:33Z</dc:date>
    </item>
    <item>
      <title>Steve, mecej4, thank you for</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132087#M134573</link>
      <description>&lt;P style="margin-left:0cm; margin-right:0cm"&gt;Steve, mecej4, thank you for your time and patience in answering my questions.&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;mecej4, thanks a lot for the details.&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;I still can't figure out why I’m getting zero.&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;Could you please explain what “OP” stands for? As mentioned above, I use the visual development environment for building and calling the DLL.&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;I’ve attached ZIP of the source files to this post for more details as requested. The DLL building and using steps are provided in the Microsoft Word document.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jan 2019 10:27:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132087#M134573</guid>
      <dc:creator>Bakhbergen</dc:creator>
      <dc:date>2019-01-13T10:27:57Z</dc:date>
    </item>
    <item>
      <title>I unzipped the attachment to</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132088#M134574</link>
      <description>&lt;P&gt;I unzipped the attachment to #8, opened AMAIN2.DSW file in the MSDEV IDE, did a rebuild, and then executed the program. It printed out the correct result. Try doing CLEAN and REBUILD.&lt;/P&gt;&lt;P&gt;You have three copies of the DLL in three different subdirectories. In this instance, since they are all identical, there is no harm; however, unless you take steps to ensure that that they remain identical, having multiple copies can cause perplexing behavior.&lt;/P&gt;&lt;P&gt;On Usenet, OP is an abbreviation for "Original Poster". In this thread, that would be "Bekbauov, Bakhbergen".&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jan 2019 13:29:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132088#M134574</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2019-01-13T13:29:00Z</dc:date>
    </item>
    <item>
      <title>Thanks, mecej4. I have tried</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132089#M134575</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;mecej4. I have tried doing CLEAN and REBUILD but it still gives zero. I've also tried using PGI Visual Fortran within the Microsoft Visual Studio 10 without success for a while. I greatly appreciate you both for your time and efforts to help me. I will let you know if there is any further update.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jan 2019 18:39:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132089#M134575</guid>
      <dc:creator>Bakhbergen</dc:creator>
      <dc:date>2019-01-13T18:39:18Z</dc:date>
    </item>
    <item>
      <title>If you don't mind, let us try</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132090#M134576</link>
      <description>&lt;P&gt;If you don't mind, let us try the following. Please open a CVF command window, create a new directory, copy the source files into that directory and, in that new directory, build the DLL and EXE using the commands that I listed in #7. Then run the resulting EXE.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jan 2019 19:40:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132090#M134576</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2019-01-13T19:40:33Z</dc:date>
    </item>
    <item>
      <title>This is a good idea. I have</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132091#M134577</link>
      <description>&lt;P&gt;This is a good idea. I have no experience with command line and will do my best to learn it.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jan 2019 20:10:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132091#M134577</guid>
      <dc:creator>Bakhbergen</dc:creator>
      <dc:date>2019-01-13T20:10:17Z</dc:date>
    </item>
    <item>
      <title>I've created IVFCVFFORUMCL</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132092#M134578</link>
      <description>&lt;P&gt;I've created IVFCVFFORUMCL directory, copied the AMAIN2.F90,&amp;nbsp;MODUL2.F90 and&amp;nbsp;SUBRO2.F90 files into that directory and, in that new directory, tried to build the DLL using the command&amp;nbsp;that you listed in #7. Screenshot of command prompt window with errors is attached. Please let me know how to proceed further. Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jan 2019 20:59:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132092#M134578</guid>
      <dc:creator>Bakhbergen</dc:creator>
      <dc:date>2019-01-13T20:59:38Z</dc:date>
    </item>
    <item>
      <title>You have to compile the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132093#M134579</link>
      <description>&lt;P&gt;You have to compile the module first. Please also TYPE the source files. Also, rather than a screenshot, please copy and paste the whole session contents.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jan 2019 21:34:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132093#M134579</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2019-01-13T21:34:27Z</dc:date>
    </item>
    <item>
      <title>Thanks, Steve. Source files'</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132094#M134580</link>
      <description>&lt;P&gt;Thanks, Steve. Source files' content is exactly the same as mecej4 wrote in #7, but there are some differences in names we used. Please find attached zip file containing the files after I tried actions below. First I used df /compile_only, which created modul2.mod and&amp;nbsp;modul2.obj. Then use of df /dll subro2 creates only subro2.lib and subro2.exp, as well as gives the following:&lt;/P&gt;&lt;P&gt;Microsoft Windows [Version 10.0.17134.523]&lt;BR /&gt;(c) Корпорация Майкрософт (Microsoft Corporation), 2018. Все права защищены.&lt;/P&gt;&lt;P&gt;C:\Users\bakhb_000&amp;gt;D:&lt;/P&gt;&lt;P&gt;D:\&amp;gt;cd TemporaryFolder\IVFCVFFORUMCL&lt;/P&gt;&lt;P&gt;D:\TemporaryFolder\IVFCVFFORUMCL&amp;gt;df /compile_only modul2&lt;BR /&gt;Compaq Visual Fortran Optimizing Compiler Version 6.6&lt;BR /&gt;Copyright 2001 Compaq Computer Corp. All rights reserved.&lt;/P&gt;&lt;P&gt;modul2&lt;/P&gt;&lt;P&gt;D:\TemporaryFolder\IVFCVFFORUMCL&amp;gt;df /dll subro2&lt;BR /&gt;Compaq Visual Fortran Optimizing Compiler Version 6.6&lt;BR /&gt;Copyright 2001 Compaq Computer Corp. All rights reserved.&lt;/P&gt;&lt;P&gt;subro2&lt;BR /&gt;Microsoft (R) Incremental Linker Version 6.00.8447&lt;BR /&gt;Copyright (C) Microsoft Corp 1992-1998. All rights reserved.&lt;/P&gt;&lt;P&gt;/entry:_DllMainCRTStartup@12&lt;BR /&gt;/ignore:505&lt;BR /&gt;/debugtype:cv&lt;BR /&gt;/debug:minimal&lt;BR /&gt;/pdb:none&lt;BR /&gt;C:\Users\BAKHB_~1\AppData\Local\Temp\objB802.tmp&lt;BR /&gt;dfordll.lib&lt;BR /&gt;msvcrt.lib&lt;BR /&gt;dfconsol.lib&lt;BR /&gt;dfport.lib&lt;BR /&gt;kernel32.lib&lt;BR /&gt;/out:subro2.dll&lt;BR /&gt;/dll&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Creating library subro2.lib and object subro2.exp&lt;BR /&gt;objB802.tmp : error LNK2001: unresolved external symbol _MODUL2_mp_A&lt;BR /&gt;objB802.tmp : error LNK2001: unresolved external symbol _MODUL2_mp_B&lt;BR /&gt;objB802.tmp : error LNK2001: unresolved external symbol _MODUL2_mp_S&lt;BR /&gt;subro2.dll : fatal error LNK1120: 3 unresolved externals&lt;/P&gt;&lt;P&gt;D:\TemporaryFolder\IVFCVFFORUMCL&amp;gt;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jan 2019 22:27:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132094#M134580</guid>
      <dc:creator>Bakhbergen</dc:creator>
      <dc:date>2019-01-13T22:27:46Z</dc:date>
    </item>
    <item>
      <title>You placed the module source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132095#M134581</link>
      <description>&lt;P&gt;You placed the module source into a separate file, but did not modify the build procedure to match that change. When building the DLL, use the command&lt;/P&gt;
&lt;PRE class="brush:bash; class-name:dark;"&gt;df /dll SUBRO2.F90 modul2.obj&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 00:02:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132095#M134581</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2019-01-14T00:02:04Z</dc:date>
    </item>
    <item>
      <title>Microsoft Windows [Version 10</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132096#M134582</link>
      <description>&lt;P&gt;Microsoft Windows [Version 10.0.17134.523]&lt;BR /&gt;(c) Корпорация Майкрософт (Microsoft Corporation), 2018. Все права защищены.&lt;/P&gt;&lt;P&gt;C:\Users\bakhb_000&amp;gt;d:&lt;/P&gt;&lt;P&gt;D:\&amp;gt;cd temporaryfolder/ivfcvfforumcl&lt;/P&gt;&lt;P&gt;D:\TemporaryFolder\IVFCVFFORUMCL&amp;gt;df /compile_only modul2.f90&lt;BR /&gt;Compaq Visual Fortran Optimizing Compiler Version 6.6&lt;BR /&gt;Copyright 2001 Compaq Computer Corp. All rights reserved.&lt;/P&gt;&lt;P&gt;modul2.f90&lt;/P&gt;&lt;P&gt;D:\TemporaryFolder\IVFCVFFORUMCL&amp;gt;df /dll subro2.f90 modul2.obj&lt;BR /&gt;Compaq Visual Fortran Optimizing Compiler Version 6.6&lt;BR /&gt;Copyright 2001 Compaq Computer Corp. All rights reserved.&lt;/P&gt;&lt;P&gt;subro2.f90&lt;BR /&gt;Microsoft (R) Incremental Linker Version 6.00.8447&lt;BR /&gt;Copyright (C) Microsoft Corp 1992-1998. All rights reserved.&lt;/P&gt;&lt;P&gt;/entry:_DllMainCRTStartup@12&lt;BR /&gt;/ignore:505&lt;BR /&gt;/debugtype:cv&lt;BR /&gt;/debug:minimal&lt;BR /&gt;/pdb:none&lt;BR /&gt;C:\Users\BAKHB_~1\AppData\Local\Temp\obj7132.tmp&lt;BR /&gt;modul2.obj&lt;BR /&gt;dfordll.lib&lt;BR /&gt;msvcrt.lib&lt;BR /&gt;dfconsol.lib&lt;BR /&gt;dfport.lib&lt;BR /&gt;kernel32.lib&lt;BR /&gt;/out:subro2.dll&lt;BR /&gt;/dll&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Creating library subro2.lib and object subro2.exp&lt;BR /&gt;LINK : warning LNK4098: defaultlib "libc.lib" conflicts with use of other libs; use /NODEFAULTLIB:library&lt;/P&gt;&lt;P&gt;D:\TemporaryFolder\IVFCVFFORUMCL&amp;gt;df amain2.f90 modul2.obj subro2.lib &amp;amp; amain2&lt;BR /&gt;Compaq Visual Fortran Optimizing Compiler Version 6.6&lt;BR /&gt;Copyright 2001 Compaq Computer Corp. All rights reserved.&lt;/P&gt;&lt;P&gt;amain2.f90&lt;BR /&gt;Microsoft (R) Incremental Linker Version 6.00.8447&lt;BR /&gt;Copyright (C) Microsoft Corp 1992-1998. All rights reserved.&lt;/P&gt;&lt;P&gt;/subsystem:console&lt;BR /&gt;/entry:mainCRTStartup&lt;BR /&gt;/ignore:505&lt;BR /&gt;/debugtype:cv&lt;BR /&gt;/debug:minimal&lt;BR /&gt;/pdb:none&lt;BR /&gt;C:\Users\BAKHB_~1\AppData\Local\Temp\obj5BCC.tmp&lt;BR /&gt;modul2.obj&lt;BR /&gt;subro2.lib&lt;BR /&gt;dfor.lib&lt;BR /&gt;libc.lib&lt;BR /&gt;dfconsol.lib&lt;BR /&gt;dfport.lib&lt;BR /&gt;kernel32.lib&lt;BR /&gt;/out:amain2.exe&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Creating library amain2.lib and object amain2.exp&lt;BR /&gt;&amp;nbsp;S = &amp;nbsp; 0.000000000000000E+000&lt;/P&gt;&lt;P&gt;D:\TemporaryFolder\IVFCVFFORUMCL&amp;gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 01:52:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132096#M134582</guid>
      <dc:creator>Bakhbergen</dc:creator>
      <dc:date>2019-01-14T01:52:47Z</dc:date>
    </item>
    <item>
      <title>That is puzzling. I do notice</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132097#M134583</link>
      <description>&lt;P&gt;That is puzzling. I do notice one point that may have a bearing on the problem: your version of CVF is slightly older than the one I have:&lt;/P&gt;
&lt;PRE class="brush:bash; class-name:dark;"&gt;Compaq Visual Fortran Optimizing Compiler Version 6.6 (Update C)
Copyright 2003 Compaq Computer Corp. All rights reserved.&lt;/PRE&gt;

&lt;P&gt;I even took the MOD, LIB and DLL files from your zip in #8, and built amain2.exe from amain2.f90 and those files. The output was 3.0.&lt;/P&gt;
&lt;P&gt;Other than that, I do not have any more suggestions for you; sorry!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 02:19:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132097#M134583</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2019-01-14T02:19:00Z</dc:date>
    </item>
    <item>
      <title>Thanks.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132098#M134584</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 02:51:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132098#M134584</guid>
      <dc:creator>Bakhbergen</dc:creator>
      <dc:date>2019-01-14T02:51:41Z</dc:date>
    </item>
    <item>
      <title>Please retry this, adding /MD</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132099#M134585</link>
      <description>&lt;P&gt;Please retry this, adding /MD to each of the df commands. On the last one, please use:&lt;/P&gt;&lt;P&gt;df /MD amain2.f90 modul2.obj subro2.lib /link /map &amp;amp; amain2&lt;/P&gt;&lt;P&gt;Then zip amain2.map and attach it to a reply here.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 16:38:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compaq-Visual-Fortran-6-6-Dynamic-Link-Library-DLL-and-Module/m-p/1132099#M134585</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2019-01-14T16:38:02Z</dc:date>
    </item>
  </channel>
</rss>

