01-24-2011 02:51 PM
When we compile a CVI project using clang32, the project is generating a number of link errors. These errors seem to be caused for each source file that includes the Windows.h file.
What can we do to eliminate these errors?
The errors are:
17 Project link errors Multiple definitions for symbol '_PtrToPtr64' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_Ptr64ToPtr' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_HandleToHandle64' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_Handle64ToHandle' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_HEAP_MAKE_TAG_FLAGS' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_RtlSecureZeroMemory' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_TpInitializeCallbackEnviron' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_TpSetCallbackThreadpool' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_TpSetCallbackCleanupGroup' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_TpSetCallbackActivationContext' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_TpSetCallbackNoActivationContext' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_TpSetCallbackLongFunction' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_TpSetCallbackRaceWithDll' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_TpSetCallbackFinalizationCallback' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_TpSetCallbackPersistent' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_TpDestroyCallbackEnviron' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'. Multiple definitions for symbol '_HRESULT_FROM_WIN32' in modules 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj' and 'C:\DOCUME~1\stevef\LOCALS~1\Temp\CVI_int_obj_60481.obj'.
Thanks,
Jim
01-25-2011 12:25 PM
Hey Jim -
This is actually a known issue for CVI 2010. A quick way around this is to enable c99 for your project.
NickB
National Instruments
09-07-2012 02:32 PM
This was also the solution to a problem where I have an old VXI Plug and Play instrument driver .fp file for an HP16500 logic analyzer. I get similar link errors for every function in the driver when I come back in after logging out. I'm running CVI version 10.0.1 with the default compiler.
I originally needed to delete the three function panels from the project, exit CVI, recompile the whole project, then add the function panels and compile again to get it to work. Your solution works much better - thanks
- Jim