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.
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).....?
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
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).
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