|
哪位高人帮忙看看阿!
我的minigui是按lite装的,程序是minigui的编程手册里自带的,但我在编译时提示出错如下:
[root@michael zjmichael626_miniGUI]# gcc -o helloworld helloworld.c -lminigui
/tmp/ccVEaRu9.o(.text+0xba): In function `MiniGUIMain':
: undefined reference to `SetDesktopRect'
collect2: ld returned 1 exit status
源程序如下:
#include <stdio.h>
#include <minigui/common.h>
#include <minigui/gdi.h>
#include <minigui/window.h>
#include <minigui/control.h>
static int HelloWinProc(HWND hWnd, int message,WPARAM wParam, LPARAM lParam)
{
HDC hdc;
switch (message) {
case MSG_PAINT:
hdc=BeginPaint (hWnd);
TextOut (hdc,100,100, "Hello world!");
EndPaint (hWnd, hdc);
return 0;
case MSG_CLOSE:
DestroyMainWindow (hWnd);
PostQuitMessage (hWnd);
return 0;
}
return DefaultMainWinProc (hWnd, message, wParam, lParam);
}
int MiniGUIMain (int argc, const char* argv[])
{
MSG Msg;
HWND hMainWnd;
MAINWINCREATE CreateInfo;
#ifdef _LITE_VERSION
SetDesktopRect (0, 0, 800, 600);
#endif
CreateInfo.dwStyle=WS_VISIBLE | WS_BORDER | WS_CAPTION;
CreateInfo.dwExStyle=WS_EX_NONE;
CreateInfo.spCaption= "HelloWorld!";
CreateInfo.hMenu=0;
CreateInfo.hCursor=GetSystemCursor(0);
CreateInfo.hIcon=0;
CreateInfo.MainWindowProc=HelloWinProc;
CreateInfo.lx=0;
CreateInfo.ty=0;
CreateInfo.rx=320;
CreateInfo.by=240;
CreateInfo.iBkColor=COLOR_lightwhite;
CreateInfo.dwAddData=0;
CreateInfo.hHosting=HWND_DESKTOP;
hMainWnd=CreateMainWindow (&CreateInfo);
if (hMainWnd==HWND_INVALID)
return -1;
ShowWindow (hMainWnd, SW_SHOWNORMAL);
while (GetMessage(&Msg, hMainWnd)) {
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
MainWindowThreadCleanup (hMainWnd);
return 0;
}
#ifndef _LITE_VERSION
#include <minigui/dti.c>
#endif |
|