<?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: Linking VF subroutine to VC++ .NET source in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846617#M64586</link>
    <description>&lt;DIV&gt;Great. Now consider migrating to Intel Visual Fortran and it will become somewhat easier...&lt;/DIV&gt;</description>
    <pubDate>Thu, 12 Feb 2004 05:52:03 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2004-02-12T05:52:03Z</dc:date>
    <item>
      <title>Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846606#M64575</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I have createda source code in VC++ .NET and I would like to use legacy Fortran subroutines. Here are the steps I have taken thus far:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;1. Successfully compiled VC++ source code without calls to VF subroutines.&lt;/DIV&gt;
&lt;DIV&gt;2. Under Project Menu, I selected "Add Existing Item to Project" where I selected my legacy VF subroutine.&lt;/DIV&gt;
&lt;DIV&gt;3. I added the "extern" command -&lt;/DIV&gt;
&lt;DIV&gt; extern "C" void lsqfit_(float a, float b, int c, int d);&lt;/DIV&gt;
&lt;DIV&gt;4. I added the call line -&lt;/DIV&gt;
&lt;DIV&gt; lsqfit_(a,b,c,d);&lt;/DIV&gt;
&lt;DIV&gt;5. I compiled successfully.&lt;/DIV&gt;
&lt;DIV&gt;6. When I tried to build the solution, I got the following error -&lt;/DIV&gt;
&lt;DIV&gt; unresolved external symbol "void __cdecl LSQFIT_(float.......&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Feb 2004 20:39:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846606#M64575</guid>
      <dc:creator>kevin_l_johnson</dc:creator>
      <dc:date>2004-02-11T20:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846607#M64576</link>
      <description>&lt;DIV&gt;Assuming your Fortran subroutine is called LSQFIT, and you are using CVF, your C++ declaration of it is incorrect. The routine name does not have a trailing underscore, by default the name is upcased and has the stdcall calling convention. You can adjust the C++ code or use the options /iface:cref /names:lowercase /assume:underscore when compiling the Fortran code. I would also question passing the arguments by value to Fortran, which would typically want to see the addresses passed instead.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Feb 2004 21:51:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846607#M64576</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2004-02-11T21:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846608#M64577</link>
      <description>&lt;P&gt;OK...I have modified my calls as you advised above, but I'm still getting the same link error when I build. Here's my modified version -&lt;/P&gt;
&lt;P&gt;VC++ source....&lt;/P&gt;&lt;FONT color="#0000ff" size="2"&gt;
&lt;P&gt;extern&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt; "C" &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;void&lt;/FONT&gt;&lt;FONT size="2"&gt; LSQFIT(&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;float&lt;/FONT&gt;&lt;FONT size="2"&gt;*xp, &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;float&lt;/FONT&gt;&lt;FONT size="2"&gt;*fxp, &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt;*nx, &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt;*maxord);&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;DIV&gt;&lt;FONT color="#0000ff" size="2"&gt;
&lt;P&gt;int&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt; main()&lt;P&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;&lt;FONT size="2"&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt; float&lt;/FONT&gt;&lt;FONT size="2"&gt; &lt;/FONT&gt;&lt;FONT size="2"&gt;fxp[1000], &lt;/FONT&gt;&lt;FONT size="2"&gt;xp[1000];&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt; int&lt;/FONT&gt;&lt;FONT size="2"&gt; &lt;/FONT&gt;&lt;FONT size="2"&gt;maxord[1], nx[1]; &lt;/FONT&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt; &lt;FONT size="2"&gt;*nx = 10;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt; *maxord = 3;&lt;/P&gt;
&lt;P&gt; LSQFIT(xp,fxp,nx,maxord);&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;CVF subroutine....&lt;/P&gt;&lt;FONT size="2"&gt;
&lt;P&gt;SUBROUTINE LSQFIT(XP,FXP,NX,MAXORD)&lt;/P&gt;
&lt;P&gt;DIMENSION XP(1),FXP(1),COEFF(11),ERR(10)...&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Feb 2004 23:09:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846608#M64577</guid>
      <dc:creator>kevin_l_johnson</dc:creator>
      <dc:date>2004-02-11T23:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846609#M64578</link>
      <description>&lt;DIV&gt;You didn't account for STDCALL. Add __stdcall to your C++ declaration of the routine.&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Feb 2004 23:13:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846609#M64578</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2004-02-11T23:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846610#M64579</link>
      <description>&lt;DIV&gt;Hey Steve,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt; I added the __stdcall to the declaration line but to no avail...I'm keep getting the linking error. When I add this subroutine to the project, do I add it as an "Existing Item"?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Kevin&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;PS - Here's my modified declaration statement -&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#0000ff" size="2"&gt;extern&lt;/FONT&gt;&lt;FONT size="2"&gt; "C" &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;void&lt;/FONT&gt;&lt;FONT size="2"&gt; &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;__stdcall&lt;/FONT&gt;&lt;FONT size="2"&gt; LSQFIT(&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;float&lt;/FONT&gt;&lt;FONT size="2"&gt;*xp, &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;float&lt;/FONT&gt;&lt;FONT size="2"&gt;*fxp, &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt;*nx, &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt;*maxord);&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Feb 2004 00:08:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846610#M64579</guid>
      <dc:creator>kevin_l_johnson</dc:creator>
      <dc:date>2004-02-12T00:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846611#M64580</link>
      <description>&lt;DIV&gt;I assume you have built the CVF source as a static library project. You would then add the .lib from that build to your VS.NET project as an existing item. You would also have to add the DF98LIB folder to the C++ libraries path.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;If you still get an error, what is the exact text of the linker error now? I am sure it has changed.&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Feb 2004 00:23:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846611#M64580</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2004-02-12T00:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846612#M64581</link>
      <description>&lt;P&gt;Hey Steve,&lt;/P&gt;
&lt;P&gt; Afteradding the df98LIB folder to Additional Library Directories, I clicked on the build button and got a huge error list consisting mostly of "already defined in *.lib" messages. The last line of the error list says - &lt;/P&gt;
&lt;P&gt;ClimbFTDRT fatal error LNK1169: one or more multiply defined symbols found&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Does this mean there are duplicate library files in the df98 subdirectory and the VC++ library?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Kevin&lt;/P&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Feb 2004 02:30:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846612#M64581</guid>
      <dc:creator>kevin_l_johnson</dc:creator>
      <dc:date>2004-02-12T02:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846613#M64582</link>
      <description>&lt;DIV&gt;It means you have "Multiple C Library Syndrome", I think (since you didn't give an example of the actual errors, I can't be sure.) Make sure the Fortran library is built with the same library type (static vs. DLL, threaded vs. non-threaded, debug vs. non-debug) as the C++ code.&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Feb 2004 03:12:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846613#M64582</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2004-02-12T03:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846614#M64583</link>
      <description>&lt;P&gt;Hey Steve,&lt;/P&gt;
&lt;P&gt; Here aresome errors from the last build -&lt;/P&gt;
&lt;P&gt;error LNK2005: ___argc already defined in LIBCMTD.lib(crt0dat.obj)&lt;/P&gt;
&lt;P&gt;error LNK2005: ___argv already defined in LIBCMTD.lib(crt0dat.obj)&lt;BR /&gt;&lt;/P&gt;
&lt;DIV&gt;The above errors are the first 2 errors of 31 that are listed.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Kevin&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Feb 2004 03:34:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846614#M64583</guid>
      <dc:creator>kevin_l_johnson</dc:creator>
      <dc:date>2004-02-12T03:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846615#M64584</link>
      <description>&lt;DIV&gt;See my above reply, and &lt;A href="http://h18009.www1.hp.com/fortran/visual/vfn10/page2.html#Karam" target="_blank"&gt;this article&lt;/A&gt;.&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Feb 2004 05:02:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846615#M64584</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2004-02-12T05:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846616#M64585</link>
      <description>&lt;P&gt;YOU DA MAN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;/P&gt;
&lt;P&gt;My libraries were out of whack. I rebuilt the fortran subroutines using the same run time libraries that I am using in the VC++ source code, then rebuilt the VC++ project, and baddah bing.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks again Steve,&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Kevin&lt;/P&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Feb 2004 05:46:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846616#M64585</guid>
      <dc:creator>kevin_l_johnson</dc:creator>
      <dc:date>2004-02-12T05:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846617#M64586</link>
      <description>&lt;DIV&gt;Great. Now consider migrating to Intel Visual Fortran and it will become somewhat easier...&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Feb 2004 05:52:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846617#M64586</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2004-02-12T05:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846618#M64587</link>
      <description>&lt;DIV&gt;Now you've got my curiosity...what does Intel Visual Fortran do differently to make this process easier?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Kevin&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Feb 2004 20:29:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846618#M64587</guid>
      <dc:creator>kevin_l_johnson</dc:creator>
      <dc:date>2004-02-12T20:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Linking VF subroutine to VC++ .NET source</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846619#M64588</link>
      <description>&lt;DIV&gt;You wouldn't have to use two separate development environments and can debug a mixed-language application. You would click "Build Solution", it would build, and the debugger would understand both languages.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;With the CVF+VC.NET combination, you have to use two separate IDEs and mixed-language debugging doesn't work.&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Feb 2004 22:47:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-VF-subroutine-to-VC-NET-source/m-p/846619#M64588</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2004-02-12T22:47:50Z</dc:date>
    </item>
  </channel>
</rss>

