Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

add __MSC_VER macro

32 views
Skip to first unread message

matth3w6247

unread,
Aug 8, 2008, 10:10:12 AM8/8/08
to
Dear CVI Users -
 
I have third party hardware, driver and example C/C++/C#, VB and Python code.  I tried to create a CVI application (a basic .uir with a quitcallback) and added the .c, .h and .dll files to the project.  When I run the debug project, I get the error window:
 
Include file "stdint.h" was not found. Do you want to look for it? 
 
I read that its for C99-compliant compiler (GCC), but that's not what I want ... right?  Below is the origin of the error from the 3rd party .h file...
 
#ifndef _MSC_VER/* C99-compliant compilers (GCC) */#include <stdint.h>typedef uint8_t   u08;:
: typedef int64_t   s64;
#else/* Microsoft compilers (Visual C++) */typedef unsigned __int8   u08;:
: typedef signed   __int64  s64;
#endif /* __MSC_VER */
 
Since CVI does not define _MSC_VER, how do manually define the _MSC_VER macro to fit the above code?
 
Thanks,
Matt
 

Dr. Doiron

unread,
Aug 11, 2008, 11:40:12 AM8/11/08
to
Hello Matthew,
 
It looks like we have a KnowledgeBase Article <a href="http://digital.ni.com/public.nsf/allkb/5B3CAD632D4960AC86256CD9002ED474" target="_blank">here</a>&nbsp;that gives you more information about this issue, #define _MSC_VER should do it for you. Please let me know if this does not answer your question.

matth3w6247

unread,
Aug 11, 2008, 3:10:13 PM8/11/08
to
Hello David and Fellow-CVI-users,
&nbsp;
Still have no success;&nbsp;I need to know where to insert the code and exactly how it should read.&nbsp; I tried both
&nbsp;
#ifndef _MSC_VER#define _MSC_VER#endif
&nbsp;
and
&nbsp;
#ifndef _MSC_VER
#define _MSC_VER
#define /MSC_VER 1200
#endif
&nbsp;
at the top of&nbsp;the .c file with main() =&nbsp;Same Errors.&nbsp;
&nbsp;
SUMMARY: When somebody declares MSC_VER, where and how is it done?&nbsp;
&nbsp;
Thank you,
Matthew

Dr. Doiron

unread,
Aug 11, 2008, 5:10:12 PM8/11/08
to
Hello Matthew,
&nbsp;
Did you try #define _MSC_VER &lt;version&gt;
&nbsp;
Where &lt;version&gt; is the number corresponding to the version you are using as mentioned in the link I provided earlier.

matth3w6247

unread,
Aug 12, 2008, 3:40:12 PM8/12/08
to
Hi
I added #define _MSC_VER 1300 to the top of the header before it checked which compilier.&nbsp;&nbsp;Then it&nbsp;jumps into the microsoft types, where&nbsp; unsigned __int8 is not known because I get
&nbsp; "aardvark.h"(81,27)&nbsp;&nbsp; syntax error; found 'identifier' expecting ';'.

#ifndef _MSC_VER/* C99-compliant compilers (GCC) */#include &lt;stdint.h&gt;typedef uint8_t&nbsp;&nbsp; u08;:
: typedef int64_t&nbsp;&nbsp; s64;
#else/* Microsoft compilers (Visual C++) */typedef unsigned __int8&nbsp;&nbsp; u08;:
: typedef signed&nbsp;&nbsp; __int64&nbsp; s64;
#endif /* __MSC_VER */
&nbsp;
Is there a way microsoft types are known?&nbsp; (i.e. there will not be complaints for unsigned __int8)
&nbsp;
Your input is greatly appreciated.
&nbsp;
Thanks
Matt
0 new messages