LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to include io.h

Hi,

I need to include <io.h> in a DLL I am writing. When I include it however (from Windows SDK), I get an error in Labwindows when it tries to compile io.h and crtdefs.h...

 tcl_ts_main.c - 20 errors
  "crtdefs.h"(506,121)   Expecting ')'
  "crtdefs.h"(506,121)   syntax error; found ')' expecting ';'.
  "io.h"(201,33)   Expecting ')'
  "io.h"(201,33)   syntax error; found ')' expecting ';'.
  "io.h"(214,131)   Expecting ')'
  "io.h"(214,131)   syntax error; found ')' expecting ';'.
  ... and so on ...

The first error points to crtdefs.h line 506 which is:

_CRT_DEPRECATE_TEXT("This name was supported during some Whidbey pre-releases. Instead, use the standard name errno_t." ) typedef int errcode;

I haven't changed anything, the error points to the end of the line where the close bracket is and says that there is no close bracket.... what gives? Has anyone got this to compile in Labwindows?

Jon


0 Kudos
Message 1 of 4
(5,903 Views)

Hello Jon,

Is this the piece of code to which the error is referring?

/* errcode is deprecated in favor or errno_t, which is part of the standard proposal */
#if !defined(__midl)
_CRT_DEPRECATE_TEXT("This name was supported during some Whidbey pre-releases. Instead, use the standard name errno_t." ) typedef int errcode;
#else
typedef int errcode;
#endif

This macro is defined to inform the user that the standard name has changed.  I was able was able to get mine up and running by removing the deprecate text macro like this:

typedef int errcode;

Please let me know if that does not solve the problem.

Message Edited by Ben M on 06-06-2007 12:26 PM

Regards,
Ben M
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(5,874 Views)

Hi Jon and Ben

I have the same problem , but in many other include files too. I have not been able to find a solution to the problem, but there should be a more general way out of the this, than change original include files from the VC SDK. In my list of errors the "_CRT_DEPRECATE_TEXT" isn't the only symbol that cause problems. Are there any project setting or compiler switches related to use of Visual Studio 2005 VC SDK include files?

Rolf

0 Kudos
Message 3 of 4
(5,861 Views)

Hello Jon and Rolf,

Rolf, I agree with you, this is a sloppy way to avoid the issue.  I am searching for a better solution and will post when I find it.  For now, this does seem to correct the problem and allow you to compile when you include the affected files.

Regards,
Ben M
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(5,823 Views)