0

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;
}
gds
  • 13
  • 3
  • Are you sure that it compiles a release version if you remove this line? Maybe, the problem is not in `cin >> a >> b` line. – Yeldar Kurmangaliyev Oct 28 '15 at 11:10
  • _"when I compile a debug version"_ This is wildly insufficient information about your environment and built parameters. – Lightness Races in Orbit Oct 28 '15 at 11:14
  • I am sure that it compiles a release version when i remve this line. And I use the defult configure in VS2015 for the debug version and release version. – gds Oct 28 '15 at 11:29
  • Try creating a new empty project and copying in your source files. – Dan Oct 28 '15 at 13:07
  • 1
    Sounds as if the linker can’t find the right version of a library? – Davislor Oct 28 '15 at 13:48
  • I have tried to copy the source files to a new empty project and test for each function. Finally I find that if I remove cin>>a>>b, the project can be built. So I write this code to test and this code can't be compiled too. – gds Oct 28 '15 at 15:32
  • I think the linker use the VC++ library instread of the intel C++ library, but I can find the iostream.h in the intel C++ compiler.. – gds Oct 29 '15 at 13:15
  • Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Niall Oct 29 '15 at 14:04
  • This is a linker error - you linking against one set of libraries in debug and something completely different in release (not just the release version of the same library). Compare the linker options and link libraries and search for libraries out of place or missing. – Niall Oct 29 '15 at 14:06

1 Answers1

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.

gds
  • 13
  • 3