02-17-2014 01:17 AM - edited 02-17-2014 01:26 AM
When building application in 64-bits with CVI 2013, I've an error about CAObjHandle that in several files:
userint.h:typedef intptr_t CAObjHandle;
cviauto.h: typedef intptr_t CAObjHandle;
stdtst: typedef int CAObjHandle;
first files are from CVI (C:\Program Files (x86)\National Instruments\CVI2013\include) and second from teststand (C:\Users\Public\Documents\National Instruments\TestStand 2013\AdapterSupport\CVI): I make a DLL with CVI and then call its functions from a seqauence in teststand.
If I compile in 32-bits, there is not such an error as types have then the same size...
What can be done to solve that?
Solved! Go to Solution.
02-17-2014 04:37 AM
Hello R1M!
an easy workaround for this issue is to use the 2 headers in 2 separate source files, so that the redefinition error doesn't happen. This would also separate the CVI ActiveX Automation types and utilities, from the ones provided by the TestStand Std Prototype Adapter.
02-17-2014 05:16 AM - edited 02-17-2014 05:19 AM
My application needs both headers, even in the same .C file.
I some times compile with 32 bits sometimes with 64 bits settings.
At the moment, compiler points automatically to those NI std files and I've seen in the directories of the machine only 1 version of each file.
I assume the right portable version is "typedef intptr_t CAObjHandle;" as intptr__t is automatically defined depending on the compilation options
Should I modify manually one of them to remove the duplicated declaration and make local copies of the files?
02-17-2014 09:36 AM - edited 02-17-2014 09:43 AM
You should change the one in stdtst.h to use intptr_t.
You should also change:
typedef void *(TX_CDECL * tMallocPtr) (unsigned int Mem_Block_Size); /* malloc() */
to:
typedef void *(TX_CDECL * tMallocPtr) (size_t Mem_Block_Size); /* malloc() */
Both of these changes really only matter for 64-bit compiled code, which TestStand 2013 does not currently support.
Hope this helps,
-Doug
02-19-2014 04:27 AM
I've modified and compilation is now OK.
For me this 2013 version was 64 bits ready: how can a potential user evaluate a version with so many errors/ non compatibilities?
Thanks.
02-19-2014 09:34 AM
TestStand 2013 does support being run on a 64-bit OS (and can use additional memory when doing so), however it does not currently support directly calling 64-bit dlls since it is a 32-bit program (the Windows OS does not support loading dlls of a different bitness within the same process).
We understand the importance of fully supporting the 64-bit architecture, and the issue you've encountered, and such issues will likely be addressed in a future version.
Please see the following forum thread for more details:
http://forums.ni.com/t5/NI-TestStand/TestStand-64bit-version/m-p/2139476/highlight/true#M38530
Please let us know if you have additional questions or issues regarding this,
-Doug