code won't compile..

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

code won't compile..

Roberto Nunnari
Hi all.

Please forgive me if this gets twice to the list.. I had
a error while sending it the first time.


This code is driving me mad.. The compiler keeps giving me
'DEV_BROADCAST_DEVICEINTERFACE' undeclared .. and more..

What am I doing wrong??

I'll attach the code and the compiler output.
I compile with:

gcc -g -Wall -pedantic -c usbDrive.c

I use mingw installed last week.

Please help!
Robi

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

usbDrive.c (1K) Download Attachment
usbDrive.o (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: code won't compile..

Roberto Nunnari
I'm sorry.. I'm very tired and attached the wrong file..
here it is.
Best regards.
Robi


On 19.09.2010 01:53, Roberto Nunnari wrote:

> Hi all.
>
> Please forgive me if this gets twice to the list.. I had
> a error while sending it the first time.
>
>
> This code is driving me mad.. The compiler keeps giving me
> 'DEV_BROADCAST_DEVICEINTERFACE' undeclared .. and more..
>
> What am I doing wrong??
>
> I'll attach the code and the compiler output.
> I compile with:
>
> gcc -g -Wall -pedantic -c usbDrive.c
>
> I use mingw installed last week.
>
> Please help!
> Robi

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

usbDrive.c (1K) Download Attachment
usbDrive.errout (768 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: code won't compile..

Roberto Nunnari
In reply to this post by Roberto Nunnari
Anybody on this, please?
Best regards.
Robi


Roberto Nunnari ha scritto:

> Hi all.
>
> Please forgive me if this gets twice to the list.. I had
> a error while sending it the first time.
>
>
> This code is driving me mad.. The compiler keeps giving me
> 'DEV_BROADCAST_DEVICEINTERFACE' undeclared .. and more..
>
> What am I doing wrong??
>
> I'll attach the code and the compiler output.
> I compile with:
>
> gcc -g -Wall -pedantic -c usbDrive.c
>
> I use mingw installed last week.
>
> Please help!
> Robi


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: code won't compile..

d3x0r
Probably MinGW32 windows headers are old and unmaintained.  Think they
stopped updating headers quite some time ago things like
UpdateLayeredWindowIndirect is also missing... MingW-w64 is more up to
date.  The structure you reference requires windows server 2000, so
that means they stopped sometime before 2000 apparently.

On Mon, Sep 20, 2010 at 12:32 AM, Roberto Nunnari
<[hidden email]> wrote:

> Anybody on this, please?
> Best regards.
> Robi
>
>
> Roberto Nunnari ha scritto:
>> Hi all.
>>
>> Please forgive me if this gets twice to the list.. I had
>> a error while sending it the first time.
>>
>>
>> This code is driving me mad.. The compiler keeps giving me
>> 'DEV_BROADCAST_DEVICEINTERFACE' undeclared .. and more..
>>
>> What am I doing wrong??
>>
>> I'll attach the code and the compiler output.
>> I compile with:
>>
>> gcc -g -Wall -pedantic -c usbDrive.c
>>
>> I use mingw installed last week.
>>
>> Please help!
>> Robi
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> MinGW-users mailing list
> [hidden email]
>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
>

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: code won't compile..

Geir Meyer
In reply to this post by Roberto Nunnari
Hi,

-----Opprinnelig melding-----
Fra: Roberto Nunnari [mailto:[hidden email]]
Sendt: ma 20.09.2010 09:32
 
>
> This code is driving me mad.. The compiler keeps giving me
> 'DEV_BROADCAST_DEVICEINTERFACE' undeclared .. and more..
>

The definition seems to be there.

When searching through all the files in /mingw for your undeclared item
'DEV_BROADCAST_DEVICEINTERFACE' it is found in dbt.h.

Your probably need to declare _WIN32_WINNT (or include the files in some order).

Hope this helps.

Regards
Geir


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

winmail.dat (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: code won't compile..

Tor Lillqvist
In reply to this post by d3x0r
> Probably MinGW32 windows headers are old and unmaintained.

That is not true, as can trivially be seen from the relevant ChangeLog
files, or just timestamps..

If you, or the original poster, just had bothered to grep, you would
have seen that DEV_BROADCAST_DEVICEINTERFACE is in the mingw dbt.h
header, but it is surrounded by:

#if (_WIN32_WINDOWS >= 0x0410 || _WIN32_WINNT >= 0x0500)

So, to make the compiler see the definition, just do

#define _WIN32_WINNT 0x0500

> Think they stopped updating headers quite some time ago

You misunderstand how Open Source works. It is not some mysterious
"they" that does all the work and which you have the right to demand
stuff from. If you find something missing from the mingw headers, and
want it to be included, you should file a bug, and provide a pointer
to where the information needed can be found in a public source.

> MingW-w64 is more up to date.

Please keep the mingw-w64 fanboyism off this list, especially if you
in the same post present false claims about the "vanilla" mingw.

>  The structure you reference requires windows server 2000, so
> that means they stopped sometime before 2000 apparently.

Blatantly false.

--tml

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: [SOLVED] code won't compile..

Roberto Nunnari
Hi Tor.

First of all thanks for your answer and all your comments.
You clarified a few doubts the previous post brought to me.

Just to leave a track for the next users bumping onto this
problem, here's the solution:

#define WINVER 0x0503
#include <windows.h>

Note the order.. WINVER has to be defined *BEFORE*
including windows.h

And to make it clear, before writing to the list I had
grepped the header files and found the surraunding
if about _WIN32_WINNT

I just thought that the mingw environment should set the
_WIN32_WINNT define automatically.. My fault.

Also note, that it seams to me that you should not set
directly _WIN32_WINNT but WINVER. _WIN32_WINNT will be
set automatically in windef.h based on the value of WINVER.

Best regards.
Robi


Tor Lillqvist ha scritto:

>> Probably MinGW32 windows headers are old and unmaintained.
>
> That is not true, as can trivially be seen from the relevant ChangeLog
> files, or just timestamps..
>
> If you, or the original poster, just had bothered to grep, you would
> have seen that DEV_BROADCAST_DEVICEINTERFACE is in the mingw dbt.h
> header, but it is surrounded by:
>
> #if (_WIN32_WINDOWS >= 0x0410 || _WIN32_WINNT >= 0x0500)
>
> So, to make the compiler see the definition, just do
>
> #define _WIN32_WINNT 0x0500
>
>>  Think they stopped updating headers quite some time ago
>
> You misunderstand how Open Source works. It is not some mysterious
> "they" that does all the work and which you have the right to demand
> stuff from. If you find something missing from the mingw headers, and
> want it to be included, you should file a bug, and provide a pointer
> to where the information needed can be found in a public source.
>
>> MingW-w64 is more up to date.
>
> Please keep the mingw-w64 fanboyism off this list, especially if you
> in the same post present false claims about the "vanilla" mingw.
>
>>  The structure you reference requires windows server 2000, so
>> that means they stopped sometime before 2000 apparently.
>
> Blatantly false.
>
> --tml
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> MinGW-users mailing list
> [hidden email]
>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users


--
Roberto Nunnari
Servizi Informatici SUPSI-DTI
SUPSI-DTI - Via Cantonale - 6928 Manno - Switzerland
email: mailto:[hidden email]
tel: +41-58-6666561

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: code won't compile..

d3x0r
In reply to this post by Tor Lillqvist




-- Sent from my Palm Pre


On Sep 20, 2010 1:57 AM, Tor Lillqvist <[hidden email]> wrote:

> Probably MinGW32 windows headers are old and unmaintained.

That is not true, as can trivially be seen from the relevant ChangeLog
files, or just timestamps..

If you, or the original poster, just had bothered to grep, you would
have seen that DEV_BROADCAST_DEVICEINTERFACE is in the mingw dbt.h
header, but it is surrounded by:


I did search for the included symbol and found it missing.  


#if (_WIN32_WINDOWS >= 0x0410 || _WIN32_WINNT >= 0x0500)

So, to make the compiler see the definition, just do

#define _WIN32_WINNT 0x0500

> Think they stopped updating headers quite some time ago

You misunderstand how Open Source works. It is not some mysterious
"they" that does all the work and which you have the right to demand
stuff from. If you find something missing from the mingw headers, and
want it to be included, you should file a bug, and provide a pointer
to where the information needed can be found in a public source

I did all that for UpdateLayeredWindowIndirect and nothing came of it.  Since it is not something that an *I* can just take care of... It must be a they


> MingW-w64 is more up to date.

Please keep the mingw-w64 fanboyism off this list, especially if you
in the same post present false claims about the "vanilla" mingw.

>  The structure you reference requires windows server 2000, so
> that means they stopped sometime before 2000 apparently.

Blatantly false.

--tml

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users