On Tue, May 15, 2012 at 10:37 PM, Ruben Van Boxem
<[email protected]>wrote:

> 2012/5/15 K. Frank <[email protected]>
>
> Hi Joshua!
>>
>> On Tue, May 15, 2012 at 3:54 AM, Joshua Boyce
>> <[email protected]> wrote:
>> > On Tue, May 15, 2012 at 1:08 AM, K. Frank <[email protected]> wrote:
>> >>
>> >> By the way, a quick semi-related question:  To use native windows
>> >> Sleep I am including windows.h.  It's not a big deal, but it does
>> >> increase the compile time of simple test programs noticeably.
>> >> (Not really a lot, though.)  Would anyone know off-hand if I can
>> >> just put in two or three lines of prototype declarations for Sleep
>> >> instead of including all of windows.h?
>> >>
>> >> Thanks to all.
>> >> ...
>> > Yes, as long as you add a __declspec(dllimport) to the function
>> declaration
>> > and also link in the appropriate import library.
>>
>> I don't follow about linking to an (additional) appropriate import
>> library.
>> Presumably I am already linking correctly when I include windows.h
>> and use Sleep in my code.  Correct me if I'm wrong, but including
>> windows.h shouldn't automatically be causing me to link any differently.
>>
>
> True. GCC links all standard windows libs automagically.
>
>
I didn't mean that an additional import library was required, simply that
the correct import lib needs to be linked in as normal (just like you do
when using windows.h). For functions exported by kernel32 this
happens automatically, for other modules (user32, advapi32, etc) I believe
they must be specified manually. Is this not true? (I'm genuinely
interested, as I thought it was true last time I checked, but it may have
just been a configuration error on my end.)
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to