GuiLite 2.0 发布:Golang 的 GUI 外衣

简介

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

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

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值