Linker Errors with IntelC++ Compiler, no errors with MSVC++ Compiler

Linker Errors with IntelC++ Compiler, no errors with MSVC++ Compiler

Hi,

We are building our VC++ projects with Intel C++ Compiler. But we are getting many LINKER errors, the same projects build without any errors with Microsoft VC++ Compiler.

ipo_61246obj.obj : error LNK2001: unresolved external symbol "class UniqueId const Meta::ModelId" (?ModelId@Meta@@3VUniqueId@@B)
ipo_61246obj.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __cdecl Log::LogMsg(int,unsigned short const *,...)" (__imp_?LogMsg@Log@@QAAXHPBGZZ)
ipo_61246obj.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall UniqueId::From(unsigned short const *)" (__imp_?From@UniqueId@@QAEXPBG@Z)

Any idea why this is happening?

Regards,
Komal

9 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

1st of all, please use the latest compiler update.

For 1st link error, try build without /Qipo and see if it goes away. if so, it's a bug in IPO.
For 2nd and 3rd, try to build the dll project without /Qipo.

To disable /Qipo:
1. open project property, under C++/Optimization, set Interprocedual Optimization to "NO"
2. under Linker/Optimization, set Interprocedual Optimization to "NO"

As for the DLL project, make sure to use "__declspec(dllexport)" for exporting any symbols.

The .def is used only at link-time and icl optimizes as much as possible, so the symbol may not exist at link time.

Jennifer

Hi Jennifer,

I am using "Intel C++ Compiler 10.0 for Windows" version.

I cannot find the option "/Qipo" in the Command Line of C++ and Linker settings (in my project).

Also i can't find a setting related to "Interprocedural Optimization" in my prject proerties. Is it because i have an older version of Intel C++ Compiler?

Regards,
Komal

Yes, please try the latest 10.1.029 or 11.1.066.

Hi Jennifer,

From where can i download Intel C++ Compiler versions 10.1.029?
I could only locate the download page for version11.1.066 (http://www.intel.com/cd/software/products/asmo-na/eng/368972.htm, which supposedly has a bug in IPO (http://software.intel.com/en-us/forums/showthread.php?t=62095) . I don't want to run into Linker Errors again, even after downloading and installing another version.

I already have an evaluation copy of 10.0 version running on one of my systems, can i update the same ro use 10.1.029 or 11.1.066 (does the evaluation version have installation restrictions?)

Thanks,
Komal

Quoting - Jennifer Jiang (Intel)

Yes, please try the latest 10.1.029 or 11.1.066.

Hi,

I used the latest version of Intel C++ Compiler 11.0.072, and the several Linker Errors, that i got with version 10 are not seen anymore. Yipeee!!!
But I am still getitng the following Linker Errors, even though this solution compiles fine with MS C++ Compiler,

xilink: executing 'link'
BuildManager.def : error LNK2001: unresolved external symbol DllCanUnloadNow
BuildManager.def : error LNK2001: unresolved external symbol DllGetClassObject
BuildManager.def : error LNK2001: unresolved external symbol DllRegisterServer
BuildManager.def : error LNK2001: unresolved external symbol DllUnregisterServer

Why are these errors coming? Am i missing something here?

Regards,
Komal

Quoting - komal_dutta
Hi,

I used the latest version of Intel C++ Compiler 11.0.072, and the several Linker Errors, that i got with version 10 are not seen anymore. Yipeee!!!
But I am still getitng the following Linker Errors, even though this solution compiles fine with MS C++ Compiler,

xilink: executing 'link'
BuildManager.def : error LNK2001: unresolved external symbol DllCanUnloadNow
BuildManager.def : error LNK2001: unresolved external symbol DllGetClassObject
BuildManager.def : error LNK2001: unresolved external symbol DllRegisterServer
BuildManager.def : error LNK2001: unresolved external symbol DllUnregisterServer

Why are these errors coming? Am i missing something here?

Regards,
Komal

Try adding the missing libraries (search on the MSDN for their name, as Ole32.lib for DllGetClassObject).

Quoting - komal_dutta
xilink: executing 'link'
BuildManager.def : error LNK2001: unresolved external symbol DllCanUnloadNow
BuildManager.def : error LNK2001: unresolved external symbol DllGetClassObject
BuildManager.def : error LNK2001: unresolved external symbol DllRegisterServer
BuildManager.def : error LNK2001: unresolved external symbol DllUnregisterServer

Why are these errors coming? Am i missing something here?

If you turn off the /GL or the /Qipo option, it will build fine.

This issue has been submitted to our engineer team to fix. It's not an easy fix.But it's been worked on.

Thanks,
Jennifer

Quoting - Jennifer Jiang (Intel)

If you turn off the /GL or the /Qipo option, it will build fine.

So it seems to be related to the incompatibility between the Microsoft version of /GL (whole program optimization) and the Intel version. These switches are on as part of standard optimizations in current versions of both Intel and Microsoft compilers, but it's necessary turn them off (/GL-) for both compilers, if you wish to link together objects built by both compilers. So it's likely to be a fixable bug only for the case where you build all your objects with Intel compilers.

Leave a Comment

Please sign in to add a comment. Not a member? Join today