Unresolved External Symbol Error at Link Phase when Enabled "/Qlong_double"


Reference Number : DPD200084693


Version : 11.1.038


Operating System : Windows


Problem Description : 

Following case will get unresolved external symbol error at linking stage if use c++ stream to pass numerical variables with option /Qlong_double specified.

Case: test006.cpp
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
            int x=0;          //line 6
            cout << x;      //line 7
}


Command:

icl /Od /Ob1 /Qlong_double /MDd test006.cpp 


Fail Output:

 -out:test006.exe
test006.obj
test006.obj : error LNK2001: unresolved external symbol "protected: virtual class std::ostreambuf_iterator<char,struct std::char_traits<char> > __thiscall std::num_put<char,class std::ostreambuf_iterator<char,struct std::char_traits<char> > >::do_put(class std::ostreambuf_iterator<char,struct std::char_traits<char> >,class std::ios_base &,char,UNKNOWN)const " (?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@D_T@Z)
test006.exe : fatal error LNK1120: 1 unresolved externals

 

While if changing line 6 & 7 to following,  the test will link fine: 

char x='0';          //line 6
cout << x;          //line 7


Currently only using the option combination like "/Ob{1|2} /Qlong_double /MD[d]" and the use of C++ stream to pass numerical variable will trigger this link failure.  


Resolution Status : 

This issue is fixed after Intel® C++ Compiler Windows* Update 3.


[DISCLAIMER: The information on this web site is intended for hardware system manufacturers and software developers. Intel does not warrant the accuracy, completeness or utility of any information on this site. Intel may make changes to the information or the site at any time without notice. Intel makes no commitment to update the information at this site. ALL INFORMATION PROVIDED ON THIS WEBSITE IS PROVIDED "as is" without any express, implied, or statutory warranty of any kind including but not limited to warranties of merchantability, non-infringement of intellectual property, or fitness for any particular purpose. Independent companies manufacture the third-party products that are mentioned on this site. Intel is not responsible for the quality or performance of third-party products and makes no representation or warranty regarding such products. The third-party supplier remains solely responsible for the design, manufacture, sale and functionality of its products. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. *Other names and brands may be claimed as the property of others.]

For more complete information about compiler optimizations, see our Optimization Notice.