GuiLite 2.0 发布:Golang 的 GUI 外衣

栏目: 软件资讯 · 发布时间: 6年前

内容简介:简介 Golang作为新生的高级语言,因为其独特的优势,迅速获得了开发者的支持,作者本身也对Golang简洁,优美的语言特性,分外喜欢。 不过遗憾的是:没有很多GUI与之搭配使用。为了响应广大开发者的期盼,我们为H...

简介

Golang作为新生的高级语言,因为其独特的优势,迅速获得了开发者的支持,作者本身也对Golang简洁,优美的语言特性,分外喜欢。
不过遗憾的是:没有很多GUI与之搭配使用。为了响应广大开发者的期盼,我们为HostMonitor制作了Golang版本,用代码详细描述了如何用Golang调用GuiLite的C++代码。
简单的来说,Golang可以方便的调用C语言,但无法直接调用C++;所以,需要将C++接口函数,用extern "C"关键字封装成C函数即可。

代码位置:https://gitee.com/idea4good/GuiLiteSamples/tree/master/HostMonitor/BuildGo

 

编译步骤(也可以见HostMonitor下的readme文件)

1. Build UIcode:
        cd HostMonitor/UIcode
        If x64/raspberry pi:
            cmake .
            make
            cp libUIcode.a ../BuildGo/libs/amd64/
        If ARM32:
            cmake -D CMAKE_C_COMPILER="/usr/bin/arm-linux-gnueabi-gcc" -D CMAKE_CXX_COMPILER="/usr/bin/arm-linux-gnueabi-g++" .
        make
        cp libUIcode.a ../BuildGo/libs/arm/
2. Build Golang:
    cd HostMonitor/BuildGo
    go build -o HostMonitor

3. 在 Linux 上的运行方法:
    Run with framebuffer:
    sudo ./HostMonitor /dev/fb0    /dev/fb0: The path of framebuffer device file.
    Run inside QT APP(display-xxx is a QT APP for display, skip this if you haven't installed QT):
    If x64: sudo ./display-x64 1 1024 768 | ./HostMonitor shared-fb
    If ARM/Raspberry Pi: sudo ./display-arm 1 1024 768 | ./HostMonitor shared-fb

最后,遇到任何问题,都欢迎大家在开发群里面讨论,我们会尽力给大家提供帮助,谢谢!
 


以上所述就是小编给大家介绍的《GuiLite 2.0 发布:Golang 的 GUI 外衣》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Making Things See

Making Things See

Greg Borenstein / Make / 2012-2-3 / USD 39.99

Welcome to the Vision Revolution. With Microsoft's Kinect leading the way, you can now use 3D computer vision technology to build digital 3D models of people and objects that you can manipulate with g......一起来看看 《Making Things See》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

SHA 加密
SHA 加密

SHA 加密工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具