设为首页收藏本站

LUPA开源社区

 找回密码
 注册
文章 帖子 博客
LUPA开源社区 首页 业界资讯 软件追踪 查看内容

GuiLite 2.0发布:Golang的GUI外衣

2019-3-16 10:00| 发布者: joejoe0332| 查看: 222| 评论: 0|原作者: oschina|来自: oschina

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

简介

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

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

酷毙

雷人

鲜花

鸡蛋

漂亮
  • 快毕业了,没工作经验,
    找份工作好难啊?
    赶紧去人才芯片公司磨练吧!!

最新评论

关于LUPA|人才芯片工程|人才招聘|LUPA认证|LUPA教育|LUPA开源社区 ( 浙B2-20090187 浙公网安备 33010602006705号   

返回顶部