I am trying to compile this piece of C codes in Visual studio 6.0 and getting errors.
Is it true that in order to use data type "HANDLE" I need to have #include <windows.h>
Can "HANDLE" be used in a c program or only C++?
I have a C executable code that need to execute and pass commands entered by user to a Java Plotting software. That is why I need to use createPipe and createProcess to make this happens. Do you have any other suggestions?
Thanks a bunch.
#include <windows.h>
void main()
{
HANDLE hread,hwrite;
CreatePipe(&hread,&write,NULL,0);
}
Compiling...
callwave.c
c:\program files\microsoft visual studio\vc98\include\winnt.h(357) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\winnt.h(376) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\winnt.h(1519) : error C2054: expected '(' to follow '_inline'
c:\program files\microsoft visual studio\vc98\include\winnt.h(1519) : error C2085: 'GetFiberData' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\winnt.h(1519) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio\vc98\include\winnt.h(1524) : error C2054: expected '(' to follow '_inline'
c:\program files\microsoft visual studio\vc98\include\winnt.h(1524) : error C2085: 'GetCurrentFiber' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\winnt.h(1524) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio\vc98\include\winnt.h(4357) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(4573) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(4577) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(4779) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(5634) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6036) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6130) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6133) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6139) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6140) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6457) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6778) : error C2133: 'pEventLogRecords' : unknown size
c:\program files\microsoft visual studio\vc98\include\winnt.h(6784) : error C2133: 'ulOffsets' : unknown size
c:\program files\microsoft visual studio\vc98\include\winbase.h(503) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\winbase.h(504) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winbase.h(1487) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1794) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1796) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1839) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1841) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winreg.h(94) : error C2061: syntax error : identifier 'QUERYHANDLER'
c:\program files\microsoft visual studio\vc98\include\winreg.h(94) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\winreg.h(94) : error C2059: syntax error : 'type'
c:\program files\microsoft visual studio\vc98\include\winreg.h(97) : error C2143: syntax error : missing '{' before '*'
c:\program files\microsoft visual studio\vc98\include\winreg.h(100) : error C2061: syntax error : identifier 'PQUERYHANDLER'
c:\program files\microsoft visual studio\vc98\include\winreg.h(101) : error C2061: syntax error : identifier 'pi_R0_allvals'
c:\program files\microsoft visual studio\vc98\include\winreg.h(101) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\winreg.h(102) : error C2061: syntax error : identifier 'pi_R3_1val'
c:\program files\microsoft visual studio\vc98\include\winreg.h(102) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\winreg.h(103) : error C2061: syntax error : identifier 'pi_R3_allvals'
c:\program files\microsoft visual studio\vc98\include\winreg.h(103) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\winreg.h(106) : error C2059: syntax error : '}'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1623) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1627) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1648) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1652) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1788) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1799) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1858) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\nb30.h(14) : error C2059: syntax error : '/'
c:\program files\microsoft visual studio\vc98\include\nb30.h(292) : error C2146: syntax error : missing ')' before identifier 'pncb'
c:\program files\microsoft visual studio\vc98\include\nb30.h(292) : error C2061: syntax error : identifier 'pncb'
c:\program files\microsoft visual studio\vc98\include\nb30.h(292) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\nb30.h(293) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\rpcasync.h(45) : warning C4115: '_RPC_ASYNC_STATE' : named type definition in parentheses
c:\program files\microsoft visual studio\vc98\include\shellapi.h(383) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\shellapi.h(422) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(135) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(139) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(164) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(168) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(238) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(245) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(249) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(256) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(261) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(275) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(283) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(287) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(294) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(299) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\rpcndr.h(1149) : error C2133: 'Format' : unknown size
c:\program files\microsoft visual studio\vc98\include\wtypes.h(1043) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\wtypes.h(1070) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\wtypes.h(1072) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\wtypes.h(1083) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\wtypes.h(1085) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\objidl.h(6235) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\objidl.h(6267) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\objidl.h(8929) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\objidl.h(8984) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\cguid.h(124) : fatal error C1071: unexpected end of file found in comment
Error executing cl.exe.
callwave.obj - 79 error(s), 1 warning(s)
Is it true that in order to use data type "HANDLE" I need to have #include <windows.h>
Can "HANDLE" be used in a c program or only C++?
I have a C executable code that need to execute and pass commands entered by user to a Java Plotting software. That is why I need to use createPipe and createProcess to make this happens. Do you have any other suggestions?
Thanks a bunch.
#include <windows.h>
void main()
{
HANDLE hread,hwrite;
CreatePipe(&hread,&write,NULL,0);
}
Compiling...
callwave.c
c:\program files\microsoft visual studio\vc98\include\winnt.h(357) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\winnt.h(376) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\winnt.h(1519) : error C2054: expected '(' to follow '_inline'
c:\program files\microsoft visual studio\vc98\include\winnt.h(1519) : error C2085: 'GetFiberData' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\winnt.h(1519) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio\vc98\include\winnt.h(1524) : error C2054: expected '(' to follow '_inline'
c:\program files\microsoft visual studio\vc98\include\winnt.h(1524) : error C2085: 'GetCurrentFiber' : not in formal parameter list
c:\program files\microsoft visual studio\vc98\include\winnt.h(1524) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio\vc98\include\winnt.h(4357) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(4573) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(4577) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(4779) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(5634) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6036) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6130) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6133) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6139) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6140) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6457) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winnt.h(6778) : error C2133: 'pEventLogRecords' : unknown size
c:\program files\microsoft visual studio\vc98\include\winnt.h(6784) : error C2133: 'ulOffsets' : unknown size
c:\program files\microsoft visual studio\vc98\include\winbase.h(503) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\winbase.h(504) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winbase.h(1487) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1794) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1796) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1839) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1841) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\winreg.h(94) : error C2061: syntax error : identifier 'QUERYHANDLER'
c:\program files\microsoft visual studio\vc98\include\winreg.h(94) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\winreg.h(94) : error C2059: syntax error : 'type'
c:\program files\microsoft visual studio\vc98\include\winreg.h(97) : error C2143: syntax error : missing '{' before '*'
c:\program files\microsoft visual studio\vc98\include\winreg.h(100) : error C2061: syntax error : identifier 'PQUERYHANDLER'
c:\program files\microsoft visual studio\vc98\include\winreg.h(101) : error C2061: syntax error : identifier 'pi_R0_allvals'
c:\program files\microsoft visual studio\vc98\include\winreg.h(101) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\winreg.h(102) : error C2061: syntax error : identifier 'pi_R3_1val'
c:\program files\microsoft visual studio\vc98\include\winreg.h(102) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\winreg.h(103) : error C2061: syntax error : identifier 'pi_R3_allvals'
c:\program files\microsoft visual studio\vc98\include\winreg.h(103) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\winreg.h(106) : error C2059: syntax error : '}'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1623) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1627) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1648) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1652) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1788) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1799) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1858) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\nb30.h(14) : error C2059: syntax error : '/'
c:\program files\microsoft visual studio\vc98\include\nb30.h(292) : error C2146: syntax error : missing ')' before identifier 'pncb'
c:\program files\microsoft visual studio\vc98\include\nb30.h(292) : error C2061: syntax error : identifier 'pncb'
c:\program files\microsoft visual studio\vc98\include\nb30.h(292) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\nb30.h(293) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\include\rpcasync.h(45) : warning C4115: '_RPC_ASYNC_STATE' : named type definition in parentheses
c:\program files\microsoft visual studio\vc98\include\shellapi.h(383) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\shellapi.h(422) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(135) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(139) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(164) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(168) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(238) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(245) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(249) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(256) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(261) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(275) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(283) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(287) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(294) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\prsht.h(299) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\rpcndr.h(1149) : error C2133: 'Format' : unknown size
c:\program files\microsoft visual studio\vc98\include\wtypes.h(1043) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\wtypes.h(1070) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\wtypes.h(1072) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\wtypes.h(1083) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\wtypes.h(1085) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\objidl.h(6235) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\objidl.h(6267) : error C2467: illegal declaration of anonymous 'struct'
c:\program files\microsoft visual studio\vc98\include\objidl.h(8929) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\objidl.h(8984) : error C2467: illegal declaration of anonymous 'union'
c:\program files\microsoft visual studio\vc98\include\cguid.h(124) : fatal error C1071: unexpected end of file found in comment
Error executing cl.exe.
callwave.obj - 79 error(s), 1 warning(s)