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

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

komal_dutta
Beginner
758 Views
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
0 Kudos
8 Replies
JenniferJ
Moderator
758 Views
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
0 Kudos
komal_dutta
Beginner
758 Views
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
0 Kudos
JenniferJ
Moderator
758 Views
Yes, please try the latest 10.1.029 or 11.1.066.
0 Kudos
komal_dutta
Beginner
758 Views
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

Yes, please try the latest 10.1.029 or 11.1.066.


0 Kudos
komal_dutta
Beginner
758 Views
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
0 Kudos
Matthieu_Brucher
Beginner
758 Views
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).
0 Kudos
JenniferJ
Moderator
758 Views
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
0 Kudos
TimP
Honored Contributor III
758 Views
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.
0 Kudos
Reply