<?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: Unresolved external symbols only in 64 bit in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870698#M72043</link>
    <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Well, this is why I suggested using BIND(C) - or perhaps DECORATE along with ALIAS. You would no longer have to worry about underscores - the compiler would "do the right thing" for the given platform.&lt;BR /&gt;</description>
    <pubDate>Mon, 11 Jan 2010 22:23:41 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2010-01-11T22:23:41Z</dc:date>
    <item>
      <title>Unresolved external symbols only in 64 bit</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870690#M72035</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm using vc9.0 and ifort11.1 on Windows XP x64, and I'm having a 64 bit Fortran problem. I get unresolved external symbols while building a 64 bit Fortran application in 64 bit. I do not get these issues while building the same Fortran application in 32 bit.&lt;BR /&gt;&lt;BR /&gt;ifort -object:C:\home\pcibin\vc9.0\cots\64BitBranch\src\pacef\debug64\ang.obj -c /nologo /W1 /iface:mixed_str_len_arg /Z7 /dbglibs -IC:\home\pciroot\64BitBranch\src\basef -IC:\home\pciroot\64BitBranch\src\pacef\NT -IC:\home\pciroot\64BitBranch\src\basef\NT "C:\home\pciroot\64BitBranch\src\pacef\ang.nt.for"&lt;BR /&gt;link /nologo /DEBUG /MACHINE:X64 /MANIFEST /OUT:C:\home\pcibin\vc9.0\cots\64BitBranch\src\pacef\debug64\ANG.EXE /LIBPATH:C:\home\pcibin\vc9.0\cots\64BitBranch\libdb64 pcif1040db.lib pcic1040db.lib core1040db.lib syslow1040db.lib counter1040db.lib network1040db.lib /incremental:no /subsystem:console /force:multiple /DEBUG "C:\home\pcibin\vc9.0\cots\64BitBranch\src\pacef\debug64\ang.obj"&lt;BR /&gt;pcif1040db.lib(impexi.obj) : warning LNK4217: locally defined symbol _exit imported in function IMPEXI&lt;BR /&gt;ang.obj : error LNK2019: unresolved external symbol __imp__idbiwr_ referenced in function MAIN__&lt;BR /&gt;ang.obj : error LNK2019: unresolved external symbol __imp__idbchw_ referenced in function MAIN__&lt;BR /&gt;pcif1040db.lib(impsts.obj) : error LNK2019: unresolved external symbol __imp__impfinit_ referenced in function IMPSTS&lt;BR /&gt;pcif1040db.lib(impsts.obj) : error LNK2019: unresolved external symbol __imp__impenv_ referenced in function IMPSTS&lt;BR /&gt;pcif1040db.lib(impexr.obj) : error LNK2001: unresolved external symbol __imp__dkgetw_&lt;BR /&gt;...&lt;BR /&gt;C:\home\pcibin\vc9.0\cots\64BitBranch\src\pacef\debug64\ANG.EXE : fatal error LNK1120: 19 unresolved externals&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;All the unresolved external symbols seems to be from C code. For some reason, it seems like it is unable to import the symbols from the pcic library. But they are there, and they are the same as in the 32 bit pcic library.&lt;BR /&gt;&lt;BR /&gt;This is the import symbol in the 32 bit pcif library:&lt;BR /&gt;&lt;BR /&gt;C:\tmp\bin32&amp;gt;dumpbin /SYMBOLS pcif1040db.lib | grep dkgetw&lt;BR /&gt;098 00000000 UNDEF  notype       External     | __imp__dkgetw_&lt;BR /&gt;&lt;BR /&gt;This is the import symbol in the 64 bit pcif library:&lt;BR /&gt;&lt;BR /&gt;C:\tmp\bin64&amp;gt;dumpbin /SYMBOLS pcif1040db.lib | grep dkgetw&lt;BR /&gt;09C 00000000 UNDEF  notype       External     | __imp__dkgetw_&lt;BR /&gt;&lt;BR /&gt;Using depends.exe I can see that the dkgetw_ symbol is defined in pcic1040db.dll in both 64 bit and 32 bit versions.&lt;BR /&gt;&lt;BR /&gt;What I'm I missing, can someone help me?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Phelippe&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Dec 2009 19:10:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870690#M72035</guid>
      <dc:creator>pneveu</dc:creator>
      <dc:date>2009-12-03T19:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Unresolved external symbols only in 64 bit</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870691#M72036</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;I'm surprised that the symbols are the same between 32-bit and 64-bit - the 64-bit symbols should have one less leading underscore. Perhaps you can try adding /verbose to the linker options and watch how it finds things in libraries.&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Dec 2009 19:46:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870691#M72036</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-12-03T19:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Unresolved external symbols only in 64 bit</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870692#M72037</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336209"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; &lt;BR /&gt;I'm surprised that the symbols are the same between 32-bit and 64-bit - the 64-bit symbols should have one less leading underscore. Perhaps you can try adding /verbose to the linker options and watch how it finds things in libraries.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Well in depends.exe the symbols looks the same, but someone here gave me this info.&lt;BR /&gt;&lt;BR /&gt;For the bin32 version of pcic1040db.lib...&lt;BR /&gt;&lt;BR /&gt; Version      : 0&lt;BR /&gt; Machine      : 14C (x86)&lt;BR /&gt; TimeDateStamp: 4B156C56 Tue Dec 01 14:19:50 2009&lt;BR /&gt; SizeOfData   : 00000018&lt;BR /&gt; DLL name     : pcic1040db.dll&lt;BR /&gt; Symbol name  : _dkgetw_&lt;BR /&gt; Type         : code&lt;BR /&gt; Name type    : no prefix&lt;BR /&gt; Hint         : 13052&lt;BR /&gt; Name         : dkgetw_&lt;BR /&gt;&lt;BR /&gt;Archive member name at 45AF40: pcic1040db.dll/&lt;BR /&gt;4B156C56 time/date Tue Dec 01 14:19:50 2009&lt;BR /&gt; uid&lt;BR /&gt; gid&lt;BR /&gt; 0 mode&lt;BR /&gt; 2D size&lt;BR /&gt;correct header end&lt;BR /&gt;&lt;BR /&gt;For the bin64 version of pcic1040db.lib...&lt;BR /&gt;&lt;BR /&gt; Version      : 0&lt;BR /&gt; Machine      : 8664 (x64)&lt;BR /&gt; TimeDateStamp: 4B15F978 Wed Dec 02 00:22:00 2009&lt;BR /&gt; SizeOfData   : 00000017&lt;BR /&gt; DLL name     : pcic1040db.dll&lt;BR /&gt; Symbol name  : dkgetw_&lt;BR /&gt; Type         : code&lt;BR /&gt; Name type    : name&lt;BR /&gt; Hint         : 13052&lt;BR /&gt; Name         : dkgetw_&lt;BR /&gt;&lt;BR /&gt;Archive member name at 476282: pcic1040db.dll/&lt;BR /&gt;4B15F978 time/date Wed Dec 02 00:22:00 2009&lt;BR /&gt; uid&lt;BR /&gt; gid&lt;BR /&gt; 0 mode&lt;BR /&gt; 2C size&lt;BR /&gt;correct header end&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So the 64 bit version does have one less _ in front of the symbol. So to make this work for both 32 bit and 64 bit, the only solution I have is too export the symbols differently in 64 bit? So I should export "_dkgetw_" in 64 bit and "dkgetw_" in 32 bit. I guess this is only valid for VC since we don't seem to have this problem using gcc and gfortran.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help,&lt;BR /&gt;&lt;BR /&gt;Phelippe&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Dec 2009 20:16:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870692#M72037</guid>
      <dc:creator>pneveu</dc:creator>
      <dc:date>2009-12-03T20:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Unresolved external symbols only in 64 bit</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870693#M72038</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Are you using gcc and gfortran on Windows? The difference in the underscore is Microsoft's published convention. If gcc and gfortran on Windows aren't obeying that, they're in error.&lt;BR /&gt;&lt;BR /&gt;Don't use depends - it is not reliable for this. Use "dumpbin -exports" on the export library instead.&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Dec 2009 21:08:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870693#M72038</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-12-03T21:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Unresolved external symbols only in 64 bit</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870694#M72039</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Lower case with appended underscore (same as linux) is normal for certain versions of gcc and gfortran. It's practically impossible to make gfortran and ifort objects work together anyway, and certainly not something which will "just work" between gcc and ifort Windows, as it would on linux. You would never be able to link 64- and 32-bit objects together, regardless of symbol case and underscoring or which compilers are involved.&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Dec 2009 22:06:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870694#M72039</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-12-03T22:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Unresolved external symbols only in 64 bit</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870695#M72040</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336209"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; &lt;BR /&gt;Are you using gcc and gfortran on Windows? The difference in the underscore is Microsoft's published convention. If gcc and gfortran on Windows aren't obeying that, they're in error.&lt;BR /&gt;&lt;BR /&gt;Don't use depends - it is not reliable for this. Use "dumpbin -exports" on the export library instead.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Sorry for my late reply, I was on vacation. I will clarify my initial problem. We have multiplatform code that we compile on Linux and Windows. On Linux we use gcc and gfortran, on Windows we use VC++ and Ifort. We recently ported our code to 64 bit. So I needed a way to compile the same code on Linux and Windows in 32 and 64 bit. We used to support alot more platforms and we had defines to properly export the symbols so that they are the same on all platforms.&lt;BR /&gt;&lt;BR /&gt;#ifdef forname_&lt;BR /&gt;# define DKGETW dkgetw_&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;#ifdef forname&lt;BR /&gt;# define DKGETW dkgetw&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;void DKGETW(...)&lt;BR /&gt;{&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;So I fixed my problem by adding a new define called _forname_ which is defined on Windows platform when compiling in 64 bit. Then I added the following block:&lt;BR /&gt;&lt;BR /&gt;#ifdef _forname_&lt;BR /&gt;#  define       DKGETW  _dkgetw_&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;I had to do this for all C symbols we were importing. It is not a trivial change, but it is the only way I found without changing our Fortran code.&lt;BR /&gt;&lt;BR /&gt;Phelippe&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Jan 2010 14:21:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870695#M72040</guid>
      <dc:creator>pneveu</dc:creator>
      <dc:date>2010-01-07T14:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Unresolved external symbols only in 64 bit</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870696#M72041</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;I don't quite understand - on 64-bit Windows, there would be neither a leading nor a trailing underscore in the external name.&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Jan 2010 15:01:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870696#M72041</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-01-07T15:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Unresolved external symbols only in 64 bit</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870697#M72042</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336209"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; &lt;BR /&gt;I don't quite understand - on 64-bit Windows, there would be neither a leading nor a trailing underscore in the external name.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;We do this so that the symbols exported are all identical for all platform/ABI combinations we compile on. If we do not do this, the symbol exported on Windows 64 bit would be dkgetw, on Windows 32 bit would be _dkgetw and on Linux 64 and 32 bit would be _dkgetw. So it means we would need to import the symbols differently when compiling on Windows in 64 bit. I think the trailing _ was added for other platforms we no longer support, so it is irrelevant.&lt;BR /&gt;&lt;BR /&gt;This is how we import the symbols in Fortran:&lt;BR /&gt;&lt;BR /&gt; SUBROUTINE DKGETW  (unit,jstrbk,numblk,buffer)&lt;BR /&gt; INTEGER unit &lt;BR /&gt; INTEGER jstrbk&lt;BR /&gt; INTEGER numblk&lt;BR /&gt; INTEGER buffer(*)&lt;BR /&gt;cDEC$ ATTRIBUTES DLLIMPORT :: DKGETW&lt;BR /&gt;cDEC$ ATTRIBUTES C, ALIAS:'_dkgetw_' ::DKGETW&lt;BR /&gt;cDEC$ ATTRIBUTES REFERENCE :: unit, jstrbk, numblk&lt;BR /&gt;cDEC$ ATTRIBUTES NO_ARG_CHECK::buffer&lt;BR /&gt; END SUBROUTINE DKGETW&lt;BR /&gt;&lt;BR /&gt;Hope it clarifies things if ever someone else runs into the same problem. I don't have any experience in Fortran, so I'm not sure if there is an easier way to do this.&lt;BR /&gt;&lt;BR /&gt;Phelippe&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Jan 2010 22:10:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870697#M72042</guid>
      <dc:creator>pneveu</dc:creator>
      <dc:date>2010-01-11T22:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Unresolved external symbols only in 64 bit</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870698#M72043</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Well, this is why I suggested using BIND(C) - or perhaps DECORATE along with ALIAS. You would no longer have to worry about underscores - the compiler would "do the right thing" for the given platform.&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Jan 2010 22:23:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Unresolved-external-symbols-only-in-64-bit/m-p/870698#M72043</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-01-11T22:23:41Z</dc:date>
    </item>
  </channel>
</rss>

