简体   繁体   中英

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

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?

--edit--

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.

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

#include<iostream>
using namespace std;

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

After I asking in the intel developer zone. They tell me the issue is ONLY reproducible with /MD and /Qipo used together, so I may use /MT to work around it. And when I use /MT, it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM