<?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 Please do the following in in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060771#M117478</link>
    <description>&lt;P&gt;Please do the following in Visual Studio:&lt;/P&gt;

&lt;P&gt;Tools &amp;gt; Options &amp;gt; Projects and Solutions &amp;gt; VC++ Project Settings &amp;gt; General. Set "Show Environment in Log" to Yes.&lt;/P&gt;

&lt;P&gt;In your C++ project, set the property Linker &amp;gt; General &amp;gt; Show Progress to "Show some progress messages".&lt;/P&gt;

&lt;P&gt;Do a build. Attach a ZIP of the Debug (or Release) folders (both Fortran and C++ projects) to a reply here so I can see the log files.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Mar 2015 18:27:00 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2015-03-25T18:27:00Z</dc:date>
    <item>
      <title>Unresolved externals</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060768#M117475</link>
      <description>&lt;P&gt;I'm using the 30-day trial of&amp;nbsp;the Intel Visual Studio 2015 with C++ and FORTRAN compilers.&amp;nbsp;I'm&amp;nbsp;evaluating for purchase and need some help please.&lt;/P&gt;

&lt;P&gt;When trying to build a simple mixed language&amp;nbsp;project with a C++ main calling a FORTRAN subroutine I get LNK2019,&amp;nbsp;unresolved external symbol&amp;nbsp;for "_sqrtf in function _G6".&amp;nbsp; The code is as follows:&lt;/P&gt;

&lt;P&gt;--- C++ code ---&lt;/P&gt;

&lt;P&gt;#included &amp;lt;cstdlib&amp;gt;&lt;/P&gt;

&lt;P&gt;extern "C" void _cdecl G6();&lt;/P&gt;

&lt;P&gt;using namespace std;&lt;/P&gt;

&lt;P&gt;int main( void )&lt;/P&gt;

&lt;P&gt;{&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; G6();&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/P&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;--- FORTRAN code ---&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUBROUTINE G6&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPLICIT NONE&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REAL SUM&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REAL ROOTSUM&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM = 1 + 2.5&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROOTSUM = SQRT(SUM)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END&lt;/P&gt;

&lt;P&gt;---------------------------------------------&lt;/P&gt;

&lt;P&gt;The FORTRAN code is compiled as a static library and linked into the C++ project.&lt;/P&gt;

&lt;P&gt;Relevant information:&lt;/P&gt;

&lt;P&gt;1. When compiled as a Release version the code compiles and executes properly.&amp;nbsp; When compiled as a Debug version the unresolved error occurs.&lt;/P&gt;

&lt;P&gt;2. I think I'm&amp;nbsp;linking in the Intel libraries correctly in the project settings - the ones in the compiler\lib\ia32 and intel64 directories.&lt;/P&gt;

&lt;P&gt;3. The above applies to a 32 bit project.&amp;nbsp; When I switch to a 64 bit project I get error #10310: "Failed to enable trusted storage check for licensing."&amp;nbsp; I will also need to correct this because we will need to compile 64 bit code.&amp;nbsp; If possible, please let me know how to resolve this when responding to the above problem - If necessary I can make this a separate question.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;Ken W.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 15:49:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060768#M117475</guid>
      <dc:creator>Ken_W_</dc:creator>
      <dc:date>2015-03-25T15:49:23Z</dc:date>
    </item>
    <item>
      <title>Ken,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060769#M117476</link>
      <description>&lt;P&gt;Ken,&lt;/P&gt;

&lt;P&gt;Welcome to the forum.&lt;/P&gt;

&lt;P&gt;First, please &lt;A href="https://software.intel.com/en-us/articles/configuring-visual-studio-for-mixed-language-applications"&gt;configure Visual C++ to link with Fortran&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Second, to fix the license problem, select Start &amp;gt; All Programs &amp;gt; Intel Parallel Studio XE 2015 &amp;gt; Compiler and Performance Libraries &amp;gt; Command Prompt with Intel Compiler XE 15.0. &lt;STRONG&gt;Right click&lt;/STRONG&gt; on any of the shortcuts shown starting with "Intel 64" and select "Run as administrator. In the command window that opens, type "ifort". Close the window. This should then eliminate the license error.&lt;/P&gt;

&lt;P&gt;Let me know what happens.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 16:11:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060769#M117476</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-25T16:11:28Z</dc:date>
    </item>
    <item>
      <title>Thanks for your prompt reply.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060770#M117477</link>
      <description>&lt;P&gt;Thanks for your prompt reply.&lt;/P&gt;

&lt;P&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp; Your solution resolved the licensing problem – Thanks.&lt;/P&gt;

&lt;P&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp; The unresolved external problem still exists (I had completed this step already.&amp;nbsp; I did re-check to make sure it was implemented correctly):&lt;/P&gt;

&lt;P&gt;a.&amp;nbsp;&amp;nbsp;&amp;nbsp; For a 32 bit project: Compiles and runs fine for release version but still get the unresolved external for the SQRT function in the debug version.&lt;/P&gt;

&lt;P&gt;b.&amp;nbsp;&amp;nbsp;&amp;nbsp; For a 64 bit project: Get a different unresolved external, this time the G6 function is now unresolved in the main.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Any help is appreciated.&lt;/P&gt;

&lt;P&gt;This only the beginning of a task to integrate C++ code with a large FORTRAN legacy code.&amp;nbsp; We will require the 64 bit project to work in both debug and release&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 18:13:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060770#M117477</guid>
      <dc:creator>Ken_W_</dc:creator>
      <dc:date>2015-03-25T18:13:14Z</dc:date>
    </item>
    <item>
      <title>Please do the following in</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060771#M117478</link>
      <description>&lt;P&gt;Please do the following in Visual Studio:&lt;/P&gt;

&lt;P&gt;Tools &amp;gt; Options &amp;gt; Projects and Solutions &amp;gt; VC++ Project Settings &amp;gt; General. Set "Show Environment in Log" to Yes.&lt;/P&gt;

&lt;P&gt;In your C++ project, set the property Linker &amp;gt; General &amp;gt; Show Progress to "Show some progress messages".&lt;/P&gt;

&lt;P&gt;Do a build. Attach a ZIP of the Debug (or Release) folders (both Fortran and C++ projects) to a reply here so I can see the log files.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 18:27:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060771#M117478</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-25T18:27:00Z</dc:date>
    </item>
    <item>
      <title>Here is an explanation of why</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060772#M117479</link>
      <description>&lt;P&gt;Ken W.:&lt;/P&gt;

&lt;P&gt;Here is an explanation of why the build went to completion in release mode but not in debug mode. The subroutine G6 has no arguments and does not reference any module or common variables. Therefore, an optimizing compiler can compile the "do nothing useful" lines of code in the subroutine to a single RET instruction, and the _sqrtf function is never referenced in the code, so no linker error occurs.&lt;/P&gt;

&lt;P&gt;However, when you compiled in debug mode, the "do nothing useful" lines of code got compiled into the OBJ file, which then contained a reference to the Fortran intrinsic _sqrtf. Since you linked the C main using the C compiler and without having configured the build system to include the Fortran runtime libraries, an "unresolved external" linker error resulted.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 11:53:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060772#M117479</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-03-26T11:53:00Z</dc:date>
    </item>
    <item>
      <title>Thanks to your help and the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060773#M117480</link>
      <description>&lt;P&gt;Thanks to your help and the help of my co-worker, I think the problem is resolved.&amp;nbsp; The first issue was with the project settings which was resolved with your help.&amp;nbsp; The second issue was "operator error" which was resolved with the help of my co-worker.&amp;nbsp; It turns out that during the confusion of getting the correct project settings correct, I was also mixing project types (debug, release, 32bit, 64bit) between the C++ and FORTRAN projects.&amp;nbsp; When I realized this and compiled matching projects with correct settings, the problems were resolved.&lt;/P&gt;

&lt;P&gt;Thanks again for all your help.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 13:42:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060773#M117480</guid>
      <dc:creator>Ken_W_</dc:creator>
      <dc:date>2015-03-26T13:42:42Z</dc:date>
    </item>
    <item>
      <title>Glad to hear it!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060774#M117481</link>
      <description>&lt;P&gt;Glad to hear it!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 14:05:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-externals/m-p/1060774#M117481</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-26T14:05:46Z</dc:date>
    </item>
  </channel>
</rss>

