MiniGui 编译hello.c 文件成功!记载一下!
MiniGui 版本v3.0 和 2 编译 差异 是极其的大!
 
源文件代码 :
 
#include <stdio.h>
#include <minigui/common.h>
#include <minigui/minigui.h>
#include <minigui/gdi.h>
#include <minigui/window.h>

static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lparam)
{
    HDC hdc;
    switch(message){
        case MSG_PAINT:
            hdc = BeginPaint(hWnd);
            TextOut(hdc, 60, 60, "duanYuLei!");
            EndPaint(hWnd, hdc);
            return 0;

        case MSG_CLOSE:
            DestroyMainWindow(hWnd);
            PostQuitMessage(hWnd);
            return 0;
    }
    return DefaultMainWinProc(hWnd, message, wParam, lparam);
}

int MiniGUIMain(int argc, char const *argv[])
{
    MSG Msg;
    HWND hMainWnd;
    MAINWINCREATE CreateInfo;

#ifdef _MGRM_PROCESSES
    JoinLayer(NAME_DEF_LAYER, "HelloWorld", 0, 0);

#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 = 240;
    CreateInfo.by = 180;
    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 _MGRM_PROCESSES
#include <minigui/dti.c>
#endif

 
照着官方文档编译都会失败。原来官方文档都不全面!
 
正确编译规则:
 
编译选项:
 
gcc HelloWorld.c -lminigui_ths -lpthread -lpng -ljpeg -lz -ldl -o (filename) 
 
无线程
 
gcc –o helloworld helloworld.c –lminigui_procs –ljpeg –lpng –lz -ldl
 
 
PS:开始画MiniGui 界面!
 
图片:
 
 
 

MINIGUI 编译 helloworld的更多相关文章

  1. 使用gnu automake编译helloworld

    使用gnu automake编译helloworld 按照许多介绍automake基本步骤的教程中的说法,我在尝试使用automake编译helloworld示例程序的时候,仍然遇到了几个小坑,所幸后 ...

  2. Linux - wxWidgets安装和编译HelloWorld

    安装参考http://codelite.org/LiteEditor/WxWidgets30Binaries#toc2 源 /etc/apt/source.list deb http://repos. ...

  3. 手动调用NDK编译HelloWorld

    首先,你得有NDK(木有的自行搜索) /home/xxxx/tools/android-ndk-r12b 准备好你的HelloWorld程序源码: #include<stdio.h> in ...

  4. centos编译helloworld的几个小问题

    1.GCC使用在使用GCC编译程序时,编译过程可以被细分为四个阶段:预处理(Pre-Processing)编译(Compiling)汇编(Assembling)链接(Linking).例如:      ...

  5. Linux下gcc和g++编译helloworld

    linux C(hello world) 1.使用vi/vim进行编写代码并保存为hello_world.c.如下: 1 2 3 4 5 6 /* This is my first C program ...

  6. HI3531编译helloworld,执行错误

    若在嵌入式系统中执行某文件出现如下错误: -/bin/sh: XXX: not found 一般是因为缺少库文件,解决方法有2: 1,文件系统的busybox编译时使用动态编译方式 2,或编译该文件的 ...

  7. RedHat下使用gcc编译HelloWorld.cpp

    gcc ./HelloWorld.cpp 错误: /tmp/ccZuz3Ca.o:(.eh_frame+0x12): undefined reference to `__gxx_personality ...

  8. minigui编译

    1, libminigui修改单 file: src/kernel/desktop.c func: def_mouse_handler keywords: MSG_DT_RBUTTONUP break ...

  9. Ubuntu中编译helloworld驱动

    1. 新建hello文件夹 2.hello.c #ifndef __KERNEL__ # define __KERNEL__ #endif #ifndef MODULE # define MODULE ...

随机推荐

  1. Putty是一个专业的SSH连接客户端

    http://www.putty.ws/PuTTY-LinuxVPS Putty是一个专业的SSH连接客户端,当然可以用来连接Linux操作系统的VPS.下文是Putty连接工具的使用方法与详细教程, ...

  2. VPS(Virtual Private Server 虚拟专用服务器)[转自百度]

    系统选择 vps上常用的操作系统是linux(有多种发行版).freeBSD,windows server等.一般来说,vps的操作系统不是自由安装的,linux系列vps可以安装多个linux发行版 ...

  3. Mono 4 和Jexus 5.6

    Mono 4 和Jexus 5.6 概述 在这篇文章中我们将讨论如何在CentOS 7操作系统,安装 jexus. mono 和 配置 jexus,因此它将能够在这种环境中运行一个asp.net mv ...

  4. 细说 ASP.NET Cache 及其高级用法【转】

    阅读目录 开始 Cache的基本用途 Cache的定义 Cache常见用法 Cache类的特点 缓存项的过期时间 缓存项的依赖关系 - 依赖其它缓存项 缓存项的依赖关系 - 文件依赖 缓存项的移除优先 ...

  5. Android学习----异常(2):Please ensure that adb is correctly located at &#39; ... &#39;

    打开任务管理器,在后台进程中找到 kadb,结束这个进程,重新启动eclipse.

  6. hdu 1002 Java 大数 加法

    http://acm.hdu.edu.cn/showproblem.php?pid=1002 PE   由于最后一个CASE不须要输出空行 import java.math.BigInteger; i ...

  7. struts2基本介绍

    前言 文本 Struts2 Apache SoftWare Foundation Tomcat/Struts1/Struts2/Ibaitas/ MVC框架:Struts1/Struts2/JSF/W ...

  8. easyui datagrid load 封装 参数问题 js 作用域

    var temp = { LoginAccount: $('#LoginAccount').val(), ShopName: $('#ShopName').val() }; function doSe ...

  9. 国内ng学习网站

    Ngnice-国内ng学习网站2015-01-25 21:30 by 破狼, 534 阅读, 3 评论,收藏, 编辑 今天给angular新手介绍一个国内开源的ng学习网站http://www.ngn ...

  10. CSS3制作日历

    目标是制作如下面DEMO显示的一个日历效果: HTML Markup 先来看看其结构: <div class="calendar"> <span class=&q ...