GO + therecipe/qt 编写的开源串口调试工具,欢迎大家拍砖和提出意见

yizheneng · 2017-07-31 01:16:10 · 5279 次点击 · 大约8小时之前 开始浏览    置顶
这是一个创建于 2017-07-31 01:16:10 的主题,其中的信息可能已经有所发展或是发生改变。


有疑问加站长微信联系(非本文作者)

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

5279 次点击  
加入收藏 微博
19 回复  |  直到 2019-01-23 12:03:15
yizheneng
yizheneng · #1 · 8年之前

捕获.PNG 捕获1.PNG

yizheneng
yizheneng · #2 · 8年之前

楼上是界面的截图,不晓得为什么没有显示出来o(╯□╰)o

channel
channel · #3 · 8年之前

这界面是 Go + QT 写的?很酷……

yizheneng
yizheneng · #4 · 8年之前

@channel 是的,欢迎试用

wufenglin
wufenglin · #5 · 8年之前

一直是这个错误啊 ..\github.com\therecipe\qt\core\core.cpp:9:30: fatal error: QAbstractAnimation: No such file or directory

yizheneng
yizheneng · #6 · 8年之前
wufenglinwufenglin #5 回复

一直是这个错误啊 ..\github.com\therecipe\qt\core\core.cpp:9:30: fatal error: QAbstractAnimation: No such file or directory

手动修改core.cpp的头文件路径

wufenglin
wufenglin · #7 · 8年之前
yizhenengyizheneng #6 回复

#5楼 @wufenglin 手动修改core.cpp的头文件路径

环境变量都加了啊 QT_VERSION | 5.8.0 | string | can also be set by using the -qt_version flag | | QT_DIR | $HOME/Qt5.8.0 or C:\Qt\Qt5.8.0 | string | can also be set by using the -qt_dir flag | | QT_STUB | false | bool | is set to true during the minimal setup | | QT_DEBUG | false | bool | set to true if you want to print function names at runtime | | QT_QMAKE_DIR 如core.cpp 加绝对目录 C:..\include\QtCore 后 QT本身头文件 包含的 QtCore/xx 又找不到 我在想 应该可以使用 //#CGO CFLAGS:-LC:..\include貌似没有效果

yizheneng
yizheneng · #8 · 8年之前
wufenglinwufenglin #7 回复

#6楼 @yizheneng 环境变量都加了啊 QT_VERSION | 5.8.0 | string | can also be set by using the `-qt_version` flag | | QT_DIR | $HOME/Qt5.8.0 or C:\Qt\Qt5.8.0 | string | can also be set by using the `-qt_dir` flag | | QT_STUB | false | bool | is set to `true` during the minimal setup | | QT_DEBUG | false | bool | set to `true` if you want to print function names at runtime | | QT_QMAKE_DIR 如core.cpp 加绝对目录 C:\..\include\QtCore 后 QT本身头文件 包含的 QtCore/xx 又找不到 我在想 应该可以使用 //#CGO CFLAGS:-LC:\..\include貌似没有效果

直接把core.cpp 中的#include <>,修改为绝对路径或相对路径不行吗?

wufenglin
wufenglin · #9 · 8年之前
yizhenengyizheneng #8 回复

#7楼 @wufenglin 直接把core.cpp 中的#include <>,修改为绝对路径或相对路径不行吗?

#include <C:\Qt\Qt5.8.0\5.8\mingw53_32\include\QtCore\QAbstractAnimation> 结果:C:\Qt\Qt5.8.0\5.8\mingw53_32\include\QtCore\qglobal.h:95:37: fatal error: QtCore/qsystemdetection.h: No such file or directory 欸:添加了//#cgo CPPFLAGS= -LC:/Qt/Qt5.8.0/5.8/mingw53_32/include 也无效

yizheneng
yizheneng · #10 · 8年之前
wufenglinwufenglin #9 回复

#8楼 @yizheneng #include 结果:C:\Qt\Qt5.8.0\5.8\mingw53_32\include\QtCore\qglobal.h:95:37: fatal error: QtCore/qsystemdetection.h: No such file or directory 欸:添加了//#cgo CPPFLAGS= -LC:/Qt/Qt5.8.0/5.8/mingw53_32/include 也无效

我记得我配置的时候是改了几个cpp包含的.h路径的,大概改了七八个文件就没有报错了

wufenglin
wufenglin · #11 · 8年之前
yizhenengyizheneng #10 回复

#9楼 @wufenglin 我记得我配置的时候是改了几个cpp包含的.h路径的,大概改了七八个文件就没有报错了

谢谢 你的 解答和项目 让我对 Cgo的 理解 在这个过程 深了 很多

wufenglin
wufenglin · #12 · 8年之前
yizhenengyizheneng #10 回复

#9楼 @wufenglin 我记得我配置的时候是改了几个cpp包含的.h路径的,大概改了七八个文件就没有报错了

您 的 go IDE 也是 用 LiteIde 吗 因为 我看见 您的 项目 rcc_cgo_xxx.go 文件已经包含 插入了 很多 头文件了啊 。我怀疑是否因为我使用 LiteIDE的问题。

yizheneng
yizheneng · #13 · 8年之前

我也用的liteide,用therecipe/qt 之前要先执行qtsetup.exe。这是是go install github.com\therecipe\qt\cmd\qtsetup 生成的

wufenglin
wufenglin · #14 · 8年之前
yizhenengyizheneng #13 回复

我也用的liteide,用therecipe/qt 之前要先执行qtsetup.exe。这是是go install github.com\therecipe\qt\cmd\qtsetup 生成的

解决 非常有价值的 项目 /*

#cgo CFLAGS: -pipe -fno-keep-inline-dllexport -O2 -Wall -Wextra -DUNICODE -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN

#cgo CXXFLAGS: -pipe -fno-keep-inline-dllexport -O2 -std=gnu++11 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN

#cgo CXXFLAGS: -I../../qt -I. -IC:/Qt/Qt5.8.0/5.8/mingw53_32/include -IC:/Qt/Qt5.8.0/5.8/mingw53_32/include/QtSvg -IC:/Qt/Qt5.8.0/5.8/mingw53_32/include/QtWidgets -IC:/Qt/Qt5.8.0/5.8/mingw53_32/include/QtGui -IC:/Qt/Qt5.8.0/5.8/mingw53_32/include/QtANGLE -IC:/Qt/Qt5.8.0/5.8/mingw53_32/include/QtCore -IC:/Qt/Qt5.8.0/5.8/mingw53_32/include/Qt3DRender -Irelease -IC:/Qt/Qt5.8.0/5.8/mingw53_32/mkspecs/win32-g++

#cgo CXXFLAGS: -IC:/Qt/Qt5.8.0/5.8/mingw53_32/include/QtMultimedia -IC:/Qt/Qt5.8.0/5.8/mingw53_32/include/QtDBus -IC:/Qt/Qt5.8.0/5.8/mingw53_32/include/QtDesigner -IC:/Qt/Qt5.8.0/5.8/mingw53_32/include/QtQuick

#cgo CXXFLAGS: -IC:/Qt/Qt5.8.0/5.8/mingw53_32/include/QtTest -IC:/Qt/Qt5.8.0/5.8/mingw53_32/include/QtSerialPort

#cgo LDFLAGS: -Wl,-s -Wl,-subsystem,windows -mthreads

#cgo LDFLAGS: -lmingw32 -LC:/Qt/Qt5.8.0/5.8/mingw53_32/lib -lqtmain -LC:/utils/my_sql/my_sql/lib -LC:/utils/postgresql/pgsql/lib -lshell32 -lQt5Core -lQt5Svg -lQt5Widgets -lQt5Gui -lQt5Core

#cgo LDFLAGS: -Wl,--allow-multiple-definition */

litianjiao
litianjiao · #15 · 7年之前

楼主出一个配置环境的教程呀- - 麻烦了

listen342325
listen342325 · #16 · 7年之前

这个能不能去掉cmd命令窗口。一关掉命令窗口,界面也会关

yizheneng
yizheneng · #17 · 7年之前
listen342325listen342325 #16 回复

这个能不能去掉cmd命令窗口。一关掉命令窗口,界面也会关

使用https://github.com/therecipe/qt/tree/master/cmd/qtdeploy 进行编译,不会出现命令提示符窗口

yizheneng
yizheneng · #18 · 7年之前

目前发现内存泄漏的问题,是由于therecipe/qt内存不能自动释放导致的,还没有找到有效的解决方案

fcymk2
fcymk2 · #19 · 6年之前

用therecipe/qt写东西编译好慢...改一点东西. 然后qtdeploy -fast build desktop 就要几十秒....

添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传