LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

definitions for CAObjHandle: stdtst.h, userint.h & cviauto.h

Solved!
Go to solution

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?

0 Kudos
Message 1 of 6
(5,069 Views)

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.

0 Kudos
Message 2 of 6
(5,054 Views)

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?

0 Kudos
Message 3 of 6
(5,047 Views)
Solution
Accepted by topic author R1M

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

0 Kudos
Message 4 of 6
(5,032 Views)

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.

0 Kudos
Message 5 of 6
(4,991 Views)

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

0 Kudos
Message 6 of 6
(4,983 Views)