compilation fails with Win32 API call
Tue Sep 20 17:04:00 GMT 2011
On 2011-09-20 PM 6:12, Andrew Schulman wrote:
> I'm trying to compile a program that calls the win32 function
> SetThreadExecutionState, in kernel32.dll . The link step fails:
> $ gcc -c nosleep.c
> $ gcc -o nosleep nosleep.o -lkernel32
> nosleep.o:nosleep.c:(.text+0x1f): undefined reference to
> nosleep.o:nosleep.c:(.text+0x5c): undefined reference to
> collect2: ld returned 1 exit status
> According to the FAQ , I shouldn't even have to include -lkernel32.
> Can someone please tell me what I'm doing wrong?
>  http://msdn.microsoft.com/en-us/library/aa373208(VS.85).aspx
here you are.
please define WINVER so that you can get definition what you want
(gcc -E -DWINVER=0x500 - <<EOF
now you can see SetThreadExecutionState is defined
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin