<?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 Your program was written in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-C-and-Fortran-programming-problem/m-p/980300#M99523</link>
    <description>&lt;P&gt;Your program was written assuming common defaults for Fortran on Linux. The C++ code assumes that Fortran routine names are downcased and have an underscore at the end, neither of which are the defaults of Intel Visual Fortran.&lt;/P&gt;
&lt;P&gt;Perhaps the easiest solution is to change the names of the Fortran entities in the C++ code to have uppercase names and remove the trailing underscore. Another option is to add BIND(C) attributes where appropriate, with a NAME= value that is the lowercase name with the underscore at the end. I see you have a COMMON block, so that's slightly trickier (need a BIND statement), but doable.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jun 2013 23:58:37 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2013-06-03T23:58:37Z</dc:date>
    <item>
      <title>Mixed C++ and Fortran programming problem.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-C-and-Fortran-programming-problem/m-p/980299#M99522</link>
      <description>&lt;P&gt;Hi, I am working on a project with C++, and there is a old ordinary equation integrator named lsode written in fortran, I'd like to call its subrutine in C++.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I &amp;nbsp;followed the instruction on this link to&amp;nbsp;Configue Microsoft Visual Studio 2010.(vv=12 for me.)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/configuring-visual-studio-for-mixed-language-applications"&gt;http://software.intel.com/en-us/articles/configuring-visual-studio-for-mixed-language-applications&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And then creat a solution with one C++ project and one fortran static library projbec, as in:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/intel-fortran-compiler-for-windows-building-mixed-language-applications-under-visual-studio/"&gt;http://software.intel.com/en-us/articles/intel-fortran-compiler-for-windows-building-mixed-language-applications-under-visual-studio/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Set the dependency and start up project. Also&amp;nbsp;explicitly provide the path to the Fortran library, in the C/C++ project's Linker &amp;gt; Additional Dependencies property, or as a "source file" in the project, like Steve said!&lt;/P&gt;
&lt;P&gt;I test a "hello world! " program written in fortran and called in C++, it works perfectly!&lt;/P&gt;
&lt;P&gt;But when I follow the procedure above and incorporate the old fortran code(a simple test), I got the error:&lt;/P&gt;
&lt;P&gt;1&amp;gt;lsode_init.obj : error LNK2001: unresolved external symbol _ckstrt_&lt;BR /&gt;1&amp;gt;main.obj : error LNK2019: unresolved external symbol _chemkininitialize_ referenced in function _main&lt;/P&gt;
&lt;P&gt;Below is my source codes:&lt;/P&gt;
&lt;P&gt;I upload every source file, global_extern_vars.h contains the extern "C" stuff, use_chemkin.f is a wrapper to the old fortran codes.&lt;/P&gt;
&lt;P&gt;Hope someone could help me.(I have worked on this problem for one week, my boss got unhappy with me as He bought VS2010 and intel fortran complier but I don't know how to use...). It would be really appreciated if u could help to fix it.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2013 23:40:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-C-and-Fortran-programming-problem/m-p/980299#M99522</guid>
      <dc:creator>Shaun_B_</dc:creator>
      <dc:date>2013-06-03T23:40:31Z</dc:date>
    </item>
    <item>
      <title>Your program was written</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-C-and-Fortran-programming-problem/m-p/980300#M99523</link>
      <description>&lt;P&gt;Your program was written assuming common defaults for Fortran on Linux. The C++ code assumes that Fortran routine names are downcased and have an underscore at the end, neither of which are the defaults of Intel Visual Fortran.&lt;/P&gt;
&lt;P&gt;Perhaps the easiest solution is to change the names of the Fortran entities in the C++ code to have uppercase names and remove the trailing underscore. Another option is to add BIND(C) attributes where appropriate, with a NAME= value that is the lowercase name with the underscore at the end. I see you have a COMMON block, so that's slightly trickier (need a BIND statement), but doable.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2013 23:58:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-C-and-Fortran-programming-problem/m-p/980300#M99523</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2013-06-03T23:58:37Z</dc:date>
    </item>
    <item>
      <title>Could you try to change the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-C-and-Fortran-programming-problem/m-p/980301#M99524</link>
      <description>Could you try to change the following in &lt;STRONG&gt;global-extern-vars.h&lt;/STRONG&gt; from:

...
extern "C"
{
...
// your declarations...
...
}

to:

...
#ifdef __cplusplus
extern "C" {
#endif
...
// your declarations...
...
#ifdef  __cplusplus
}
#endif</description>
      <pubDate>Tue, 04 Jun 2013 04:26:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-C-and-Fortran-programming-problem/m-p/980301#M99524</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-06-04T04:26:43Z</dc:date>
    </item>
    <item>
      <title>This is because your main C/C</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-C-and-Fortran-programming-problem/m-p/980302#M99525</link>
      <description>This is because your main C/C++ source file ( &lt;STRONG&gt;lsode-init.cpp&lt;/STRONG&gt; ) has extension &lt;STRONG&gt;cpp&lt;/STRONG&gt;.</description>
      <pubDate>Tue, 04 Jun 2013 04:29:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-C-and-Fortran-programming-problem/m-p/980302#M99525</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-06-04T04:29:16Z</dc:date>
    </item>
    <item>
      <title>Thanks a million!!! I try all</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-C-and-Fortran-programming-problem/m-p/980303#M99526</link>
      <description>&lt;P&gt;Thanks a million!!! I try all your solutions and Steve's idea works better! I simply migrate linux codes to windows which is not correct!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2013 15:53:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-C-and-Fortran-programming-problem/m-p/980303#M99526</guid>
      <dc:creator>Shaun_B_</dc:creator>
      <dc:date>2013-06-04T15:53:02Z</dc:date>
    </item>
  </channel>
</rss>

