Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
7782 Discussions

Linker error using c++ Compiler 16 for windows

shachar-arieli
Beginner
282 Views

I am upgrading the c++ compiler from version 15 to 16 (on windows 7) using visual studio 2010 IDE

The compilation passes ok but i get many linker error on the same issue

Following are a couple of errors from the long list of similar errors :

Error    290    error LNK2005: "class F64vec8 __cdecl andnot(class F64vec8 const &,class F64vec8 const &)" (?andnot@@YA?AVF64vec8@@AEBV1@0@Z) already defined in sys.lib(c_run_graph.obj)    D:\VsProjects\VS4-Ver1.8x64\src\evpcon\svp.lib(cRawDataFilterSliceMgr.obj)

Error    308    error LNK2005: "class F64vec8 __cdecl andnot(class F64vec8 const &,class F64vec8 const &)" (?andnot@@YA?AVF64vec8@@AEBV1@0@Z) already defined in sys.lib(c_run_graph.obj)    D:\VsProjects\VS4-Ver1.8x64\src\evpcon\alg.lib(c_AGC_alg.obj)

Any idea how to handle this? Compiler version 15 works without any issues on the same code.

 

0 Kudos
4 Replies
Kittur_G_Intel
Employee
282 Views

The error LNK2005 means that you have symbols that are multiply defined so you'll need to check the message and find out the symbol in question and fix your code. Looking at the message "class F64vec8 __cdecl andnot(...)" looks like it's defined in more than one library (alg, svp).....?

_Kittur

shachar-arieli
Beginner
282 Views

Thanks for the reply.

The symbols are not part of our code they seem to be part of the Intel MIC classes.

When i switch the compiler from version 16 to version 15 (without any other changes) the project is compiled without any errors.

What can i do to correct this? It seems to be related to the changes in the new compiler

TimP
Black Belt
282 Views

If you have the 15.0 compiler libraries specified as a Visual Studio dependency or in the Windows default library dependencies, or copied into your project, you'll need to remove or update those (wild guess about the problem).

Ravi_N_Intel
Employee
282 Views

With 16.0 compiler we changed how MIC binaries are built.  
If you compile with 15.0  using the following option -offload-option,mic,ld,"-z defs"  you will encounter the same error.  

Best way to fix is find out which include file the class is defined and add #pragma offload_attribute(push, target(mic))/#pragma offload_attribute(pop) around the include file

 

 

Reply