This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

LockWorkStation()


I'm trying to compile the following program:

--------------------------------------
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <winuser.h>

int main()
{
        return LockWorkStation();
}
--------------------------------------

on my Win2k box. It works with the MSVC compiler and the command line

$ cl lock.c /link user32.lib

but it fails when compiling with gcc:

$ gcc -luser32 -o lock lock.c
/tmp/ccBhEMhI.o(.text+0xc):lock.c: undefined reference to `LockWorkStation'
collect2: ld returned 1 exit status

Looking through the header file /usr/include/winuser.h shows that
LockWorkStation is never declared, while it is declared in the Microsoft
include files as:

#if(_WIN32_WINNT >= 0x0500)
WINUSERAPI
BOOL
WINAPI
LockWorkStation(
    VOID);
#endif /* _WIN32_WINNT >= 0x0500 */

How do I compile this with gcc/Cygwin?

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]