<?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: Problem with program based on DLLs, lib files and source co in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-program-based-on-DLLs-lib-files-and-source-code/m-p/797270#M35880</link>
    <description>&lt;DIV&gt;OK, method used in DllExp2 explains it (but it's pretty ugly solution in my opinion). Any reason you don'tmerge Dll1 and Dll2 into &lt;STRONG&gt;one&lt;/STRONG&gt;? Such "circular" dependencies are a sign of bad design. &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;First, have in mind that .lib file which you get when building a dll is not "real" code. Basically, it serves only two purposes:&lt;/DIV&gt;
&lt;DIV&gt;- it keeps linker happy&lt;/DIV&gt;
&lt;DIV&gt;- it tells the Windows which DLL's to load when loading the process (&amp;amp; where to find the called routines)&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thus, if you link with the Dll2.obj file, you don't use Dll2.dll at all -- you're statically linking with Dll2.for (i.e. the result is as if you inserted Dll2.for into .exe's project).&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;But I still don't get "nothing happens" part -- if something is screwed up, I'd expect a crash, access violation, "dll not found" message, or something similar. Plain ommision to execute the subroutine in Dll2 is in my opinion pretty much impossible.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Also, I didn't quitesee the relationship with"redistribution of source code" you mentioned in your first post -- if you distribute only dll's to the end users, they can't see any source codes.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Jugoslav&lt;/DIV&gt;</description>
    <pubDate>Wed, 15 Sep 2004 21:50:56 GMT</pubDate>
    <dc:creator>Jugoslav_Dujic</dc:creator>
    <dc:date>2004-09-15T21:50:56Z</dc:date>
    <item>
      <title>Problem with program based on DLLs, lib files and source code</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-program-based-on-DLLs-lib-files-and-source-code/m-p/797267#M35877</link>
      <description>&lt;DIV&gt;Hi. Once again I need your help. I have developed a program based on two DLLs, DLL1.DLL and DLL2.DLL. Both DLLs interact with each other. DLL1 calls subroutines stored in DLL2 and vice versa. For some reason, I am allowed to distribute the source code of DLL1 (SRCDLL1.FOR)but not the code of DLL2. Therefore, I provide a lib file which corresponds to DLL2. However, executing a main program (MAIN.FOR) which calls a subroutine stored in SRCDLL1.FOR which then calls a subroutine in DLL2.DLL does not seem to work. But everything works fine when I link both lib files of the two DLLs to the main program. Why is that? How can I solve this problem?&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2004 17:47:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-program-based-on-DLLs-lib-files-and-source-code/m-p/797267#M35877</guid>
      <dc:creator>olmak</dc:creator>
      <dc:date>2004-09-14T17:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with program based on DLLs, lib files and source co</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-program-based-on-DLLs-lib-files-and-source-code/m-p/797268#M35878</link>
      <description>&lt;DIV&gt;Sorry, I don't follow you... can you describe your setup more precisely?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;EM&gt;Both DLLs interact with each other. DLL1 calls subroutines stored in DLL2 and vice versa. &lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV&gt;How did you manage to do that at all? You would get linker errors unless you have both libs at the same time -- it's doable but it's not easy (DllExp2 sample shows the complicated technique with makefile).&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;EM&gt;However, executing a main program (MAIN.FOR) which calls a subroutine &lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;EM&gt;stored in SRCDLL1.FOR which then calls a subroutine in DLL2.DLL does not seem to work.&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Can you elaborate "does not seem to work"? &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Jugoslav&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Sep 2004 19:42:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-program-based-on-DLLs-lib-files-and-source-code/m-p/797268#M35878</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2004-09-15T19:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with program based on DLLs, lib files and source co</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-program-based-on-DLLs-lib-files-and-source-code/m-p/797269#M35879</link>
      <description>&lt;DIV&gt;
&lt;DIV&gt;I applied the same technique as presented in the example DLLEXP2. After running nmake with a prepared makefile I got two initial lib files. After that I was able to proceed with a standard CVF (v6.6.C) project building new DLLs with new lib files. &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Linking the project mentioned above is no problem at all. But when calling asubroutine from the DLL (DLL2.DLL) nothing happens. Although all routines are present during linking, the call of any routine stored in the second DLL is impossible.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;In the meantime I found out that my program runs normally when I use the object file DLL2.OBJ instead of the corresponding lib file. But I still don't understand the reason for that. Using the lib file would be more convenient.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I am looking forward to your comments.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Many thanks in advance.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Sep 2004 20:19:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-program-based-on-DLLs-lib-files-and-source-code/m-p/797269#M35879</guid>
      <dc:creator>olmak</dc:creator>
      <dc:date>2004-09-15T20:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with program based on DLLs, lib files and source co</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-program-based-on-DLLs-lib-files-and-source-code/m-p/797270#M35880</link>
      <description>&lt;DIV&gt;OK, method used in DllExp2 explains it (but it's pretty ugly solution in my opinion). Any reason you don'tmerge Dll1 and Dll2 into &lt;STRONG&gt;one&lt;/STRONG&gt;? Such "circular" dependencies are a sign of bad design. &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;First, have in mind that .lib file which you get when building a dll is not "real" code. Basically, it serves only two purposes:&lt;/DIV&gt;
&lt;DIV&gt;- it keeps linker happy&lt;/DIV&gt;
&lt;DIV&gt;- it tells the Windows which DLL's to load when loading the process (&amp;amp; where to find the called routines)&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thus, if you link with the Dll2.obj file, you don't use Dll2.dll at all -- you're statically linking with Dll2.for (i.e. the result is as if you inserted Dll2.for into .exe's project).&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;But I still don't get "nothing happens" part -- if something is screwed up, I'd expect a crash, access violation, "dll not found" message, or something similar. Plain ommision to execute the subroutine in Dll2 is in my opinion pretty much impossible.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Also, I didn't quitesee the relationship with"redistribution of source code" you mentioned in your first post -- if you distribute only dll's to the end users, they can't see any source codes.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Jugoslav&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Sep 2004 21:50:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-program-based-on-DLLs-lib-files-and-source-code/m-p/797270#M35880</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2004-09-15T21:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with program based on DLLs, lib files and source co</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-program-based-on-DLLs-lib-files-and-source-code/m-p/797271#M35881</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;You are right. Such circular dependencies are ugly. But nevertheless, I have to use them so far. The program crashes in debug mode (when executing the program it runs without calling any subroutine of DLL2). Although DLL2 is obviously loaded, it says "no matching symbolic information found". Hope this helps. DLL2.DLL is stored in a directory with path access.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I am allowed to distribute only one part of the source code (the one of DLL1). The other part must be in compiled form. But the user would like to be able to make changes to DLL1. Thus, I guess the solution with the object files is a nice "workaround".&lt;/DIV&gt;&lt;P&gt;Message Edited by olmak on &lt;SPAN class="date_text"&gt;09-15-2004&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;08:19 AM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2004 22:17:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-program-based-on-DLLs-lib-files-and-source-code/m-p/797271#M35881</guid>
      <dc:creator>olmak</dc:creator>
      <dc:date>2004-09-15T22:17:26Z</dc:date>
    </item>
  </channel>
</rss>

