Linker error when improving GetLargestConsoleWindowSize

Hugh McMaster hugh.mcmaster at
Wed Mar 27 19:21:54 CDT 2013

-----Original Message-----
From: Eric Pouech [mailto:eric.pouech at] 
Sent: Wednesday, 27 March 2013 8:54 AM
To: wine-devel at
Subject: Re: Linker error when improving GetLargestConsoleWindowSize

Ken Thomases wrote:
 >This won't be able to work. The linker error is telling you, effectively, that you're not importing user32. However, kernel32 can't import user32. Kernel32 is at a lower level than user32. And a console program especially can't rely on user32 being loaded and initialized to satisfy the request you're making. Regards, Ken

Eric Pouech wrote:
>> actually the correct fix would be to transfer this computation to wineconsole (which already imports user32), but thats' not a really trivial task

So, if wineconsole imports user32 to run console programs, that explains why a generic program using SystemParametersInfo or GetSystemMetrics is able to compile and run correctly, yes? For example:

#include <windows.h>
#include <winuser.h>
#include <stdio.h>

    RECT workarea;

    SystemParametersInfo(SPI_GETWORKAREA, 0, &workarea, 0);

    int screen_x = workarea.right;
    int screen_y = workarea.bottom;

    printf("Your screen resolution is %d x %d pixels.\n", screen_x, screen_y);
Anyway, if I understand you correctly, the computations would need to be moved to programs/wineconsole (wineconsole.c).


More information about the wine-devel mailing list