NO

Author Topic: windows ioctl.h compilation error  (Read 5814 times)

henka

  • Guest
windows ioctl.h compilation error
« on: April 04, 2007, 01:56:03 PM »
Dear all,

First I must say that Pelles C is amazing.
Unfortunately, I ran in something what I think is a bug.

The following source will generate a high number of compilation errors with Pelles C 4.50.113:

#include <winioctl.h>

int main(void)
{
    return 0;
}

This will result in (just the first and last lines):

Building test.obj.
C:\Program Files\PellesC\Include\Win\winioctl.h(160): error #2078: Invalid struct field declarations.
C:\Program Files\PellesC\Include\Win\winioctl.h(160): error #2001: Syntax error: found 'DWORD' - expecting '}'.
C:\Program Files\PellesC\Include\Win\winioctl.h(161): warning #2099: Missing type specifier.
C:\Program Files\PellesC\Include\Win\winioctl.h(161): error #2001: Syntax error: found 'DeviceNumber' - expecting ';'.
C:\Program Files\PellesC\Include\Win\winioctl.h(161): warning #2099: Missing type specifier.
C:\Program Files\PellesC\Include\Win\winioctl.h(162): warning #2099: Missing type specifier.
C:\Program Files\PellesC\Include\Win\winioctl.h(162): error #2001: Syntax error: found 'PartitionNumber' - expecting ';'.
C:\Program Files\PellesC\Include\Win\winioctl.h(162): warning #2099: Missing type specifier.

...
...
C:\Program Files\PellesC\Include\Win\winioctl.h(435): warning #2099: Missing type specifier.
C:\Program Files\PellesC\Include\Win\winioctl.h(435): error #2001: Syntax error: found 'Length' - expecting ';'.
C:\Program Files\PellesC\Include\Win\winioctl.h(435): fatal error #2210: More than 100 errors, please improve yourself.
If you are compiling a Windows program: make sure you use the /Ze option!
*** Error code: 1 ***
Done.


The offending header lines like

typedef struct _STORAGE_DEVICE_NUMBER {
    DEVICE_TYPE DeviceType;
    DWORD DeviceNumber;
    DWORD PartitionNumber;
} STORAGE_DEVICE_NUMBER, *PSTORAGE_DEVICE_NUMBER;

look fine to me.

Has somebody else seen this same issue ?

Thanks, Henk

skirby

  • Guest
Re: windows ioctl.h compilation error
« Reply #1 on: April 04, 2007, 02:30:29 PM »
Hello Henk,

Simply add the following line above your first include and it should correct your problem.

Code: [Select]
#include <windows.h>

henka

  • Guest
Re: windows ioctl.h compilation error
« Reply #2 on: April 04, 2007, 02:39:42 PM »
That worked !!!  Thanks.

So I have to dig deeper in my real problem.

Thanks, Henk