Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Compile error with "cin >> a >> b" with intel c++ compile in release version

zhenxiao_l_
Beginner
666 Views

When I use the intel C++ compiler with VS2015 to compile a release version, it will fail. But when I compile a debug version, it work. I can't understand what happen. It the configure have some wrong? The error list is in below. How can I do?

warn #11021    unresolved __imp_?_Src@?3??_Getffld@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator@DU?$char_traits@D@std@@@3@1AAVios_base@3@PAH@Z@4QBDB    test        1

error    #11023    Not all components required for linking are present on command line    test        1

The code is here.

#include<iostream>
using namespace std;

int main()
{
    int a, b;
    while (cin >> a >> b)
    cout << a << ' ' << b;
    return 0;
}

 

0 Kudos
8 Replies
KitturGanesh
Employee
666 Views

I think you may have different property settings for the release build than the debug build.  Check the project configuration properties for the release mode and ensure you have set similar properties like that you have for your debug configuration except for the debug flag, such as the platform, C/C++ and linker settings etc.

_Kittur

0 Kudos
zhenxiao_l_
Beginner
666 Views

Today I compare the configure between the debug version and the release version in each option, I finally find if I set interprocedural optimization to no or single-file(/Qip), it works. But if i set the interprocedural optimization to Multi-File(/Qipo), it doesn't work. Besides, I can't find the iostream in the intel C++ compiler include path, the project seem like to use the library in VC++, it that the reason why I can't compile? How can I solve this problem? Thanks a lot.

0 Kudos
KitturGanesh
Employee
666 Views

Regarding the include files coming from VC that's expected since the compiler doesn't use its own but is based on VC++ includes and follows the VC++ search path accordingly. Of course, the compiler include directory contains its own intrinsic header files, optimized math and string headers etc.. Assuming the error you're getting is still what you mentioned at the very start of this thread with -ipo then there could be an issue with ipo and could be related to the environment as well. Can you do the following:

1) Go to start menu item for the product and click the "command prompt with Intel Compiler" item to open the command window. This should set all the necessary environment properly for the compiler.  You can look at the documentation as well (https://software.intel.com/en-us/node/522358) on how to bring up the Intel command line window
2) Now try to manually compile  % icl -c -ipo <source files>    

If the error still exists, then can you attach the following:
a) 
the dump of the environment settings on that terminal (%set)  
b) the dump of %icl /QV
c) the dump of the above compile execution including the error message you get as well?  
d) Finally can you also execute %icl /dryrun -c <source files> and attach the output as well for further investigation? 

_Kittur 

0 Kudos
Shenghong_G_Intel
666 Views

Hi Zhenxiao/Kittur,

I've submitted several issues simliar like this previously, this issue seems same with #3 mentined in this thread: https://software.intel.com/en-us/forums/intel-c-compiler/topic/565207.

The issue is fixed in our mainline, hope to see it in future version.

By the way, I can reproduce it with Zhenxiao's test case and to be mentioned, the issue is ONLY reproducible with /MD and /Qipo used together, you may use /MT to work around it.

: type test.cpp
#include<iostream>
using namespace std;

int main()
{
    int a, b;
    while (cin >> a >> b)
    cout << a << ' ' << b;
    return 0;
}
: icl /nologo test.cpp /O2 /Qipo /MD
test.cpp
ipo: warning #11021: unresolved __imp_?_Src@?3??_Getffld@?$num_get@DV?$istreambu
f_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBAHPEADAEAV?$istreambuf_iterator
@DU?$char_traits@D@std@@@3@1AEAVios_base@3@PEAH@Z@4QBDB
        Referenced in E:\TEMP\ipo_1801611.obj
ipo: error #11023: Not all components required for linking are present on comman
d line

: icl /nologo test.cpp /O2 /Qipo /MT
test.cpp

:

Thanks,

Shenghong

 

0 Kudos
zhenxiao_l_
Beginner
666 Views

Hi shenghong/Kittur,

Thanks a lot for your help! Now I use /MT and it work.

Zhenxiao

0 Kudos
KitturGanesh
Employee
666 Views

@Shenghong, interesting and thanks for pointing out the link with #3 and I agree is fixed in our mainline. 
 

@Zhenxiao:  Thanks for your patience and we'll keep you updated as soon as the release with the fix is out (sometime this quarter).

_Kittur 

0 Kudos
Shenghong_G_Intel
666 Views

@Zhenxiao,

Compiler 16.0 Update 1 version is released already, which contain the fix for this issue, please upgrade and verify it.

Thanks,

Shenghong

0 Kudos
KitturGanesh
Employee
666 Views

Thanks Shenghong, it was just released and does contain the fix, thanks.

_Kittur

0 Kudos
Reply