开源改变世界

实验分支的构建说明是什么? #508

推推 grbl 2年前 (2023-02-01) 147次浏览
打开
martinhansdk 打开了这个问题 2021 年 8 月 17 日 · 6条评论
打开

实验分支的构建说明是什么?#508

martinhansdk 打开了这个问题 2021 年 8 月 17 日 · 6条评论

注释

实验分支的构建说明是什么? #508
马丁汉斯克 评论了 2021 年 8 月 17 日  

版本

  • 蜡烛版:实验]

电脑信息

  • 操作系统:Linux

描述
我想为开发做出贡献。似乎目前正在实验分支中进行开发,该分支与主分支有很大不同。我已经弄清楚如何构建主分支,但实验分支让我难住了。我已经下载了Qt 5.4.2,但是我的Kubuntu系统已经安装了更新版本的Qt(不可避免地,它是基于Qt的),所以qmake似乎总是想使用系统版本而不是5.4.2。我用 qtchooser 和 QT_SELECT 环境变量尝试了各种方法,但 qmake 总是混合使用 5.4.2 和系统版本:

$ QT_SELECT=5.4.2 ~/Qt5.4.2/5.4/gcc_64/bin/qmake candle.pro
Updating 'camera/translation_ru.qm'...
Removing translations equal to source text in 'camera/translation_ru.qm'...
    Generated 9 translation(s) (9 finished and 0 unfinished)
Updating 'usercommands/translation_ru.qm'...
Removing translations equal to source text in 'usercommands/translation_ru.qm'...
    Generated 10 translation(s) (10 finished and 0 unfinished)
Updating 'coordinatesystem/translation_ru.qm'...
Removing translations equal to source text in 'coordinatesystem/translation_ru.qm'...
    Generated 6 translation(s) (6 finished and 0 unfinished)
$ make
cd src/designerplugins/ && ( test -e Makefile || /home/martin/Qt5.4.2/5.4/gcc_64/bin/qmake /home/martin/extcode/Candle/src/designerplugins/designerplugins.pro -o Makefile ) && make -f Makefile 
make[1]: Entering directory '/home/martin/extcode/Candle/src/designerplugins'
cd cameraplugin/ && ( test -e Makefile || /usr/lib/qt5/bin/qmake -o Makefile /home/martin/extcode/Candle/src/designerplugins/cameraplugin/cameraplugin.pro ) && make -f Makefile 
make[2]: Entering directory '/home/martin/extcode/Candle/src/designerplugins/cameraplugin'
make[2]: Nothing to be done for 'first'.
make[2]: Leaving directory '/home/martin/extcode/Candle/src/designerplugins/cameraplugin'
cd customwidgetsplugin/ && ( test -e Makefile || /usr/lib/qt5/bin/qmake -o Makefile /home/martin/extcode/Candle/src/designerplugins/customwidgetsplugin/customwidgetsplugin.pro ) && make -f Makefile 
make[2]: Entering directory '/home/martin/extcode/Candle/src/designerplugins/customwidgetsplugin'
make[2]: Nothing to be done for 'first'.
make[2]: Leaving directory '/home/martin/extcode/Candle/src/designerplugins/customwidgetsplugin'
make[1]: Leaving directory '/home/martin/extcode/Candle/src/designerplugins'
cd src/candle/ && ( test -e Makefile || /home/martin/Qt5.4.2/5.4/gcc_64/bin/qmake /home/martin/extcode/Candle/src/candle/candle.pro -o Makefile ) && make -f Makefile 
make[1]: Entering directory '/home/martin/extcode/Candle/src/candle'
g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DUNIX -DsNan="65536" -D_USE_MATH_DEFINES -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_UITOOLS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_SCRIPT_LIB -DQT_CORE_LIB -I. -I../designerplugins/customwidgetsplugin -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtOpenGL -I/usr/include/x86_64-linux-gnu/qt5/QtUiTools -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtSerialPort -I/usr/include/x86_64-linux-gnu/qt5/QtScript -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o frmmain.o frmmain.cpp
In file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/qtguiglobal.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qtwidgetsglobal.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qfiledialog.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QFileDialog:1,
                 from frmmain.cpp:4:
frmmain.cpp: In constructor ‘frmMain::frmMain(QWidget*)’:

你如何建造它?

实验分支的构建说明是什么? #508

看看这个:#488(评论)
我在您的帖子中看不到实际的错误消息,我认为它就在您复制的文本下方。

实验分支的构建说明是什么? #508

谢谢,@ondras12345. 使用#488中的说明,我得到了这个:

在 Ubuntu 上,从https://download.qt.io/new_archive/qt/5.4/5.4.2/下载 QT 5.4.2 ,将其安装在~/Qt5.4.2.

cd Candle
qtchooser -install 5.4.2 /home/martin/Qt5.4.2/5.4/gcc_64/bin/qmake
export PATH=~/Qt5.4.2/5.4/gcc_64/bin/:$PATH
export QT_SELECT=5.4.2

# apply fixes from #488 
sed 's:-L../designerplugins/customwidgetsplugin/release -lcustomwidgets:-L../designerplugins/customwidgetsplugin -lcustomwidgets:' -i src/candle/candle.pro
sed 's:../designerplugins/customwidgetsplugin/release -lcustomwidgets:../designerplugins/customwidgetsplugin -lcustomwidgets:' -i src/scriptbindings/qtbindings/qtscript_custom/qtscript_custom.pro
sed 's:\(Q_DECLARE_METATYPE(QList<QSslError >)\)://\1:' -i src/scriptbindings/generated_cpp/com_trolltech_qt_network/qtscriptshell_QNetworkReply.cpp
sed 's:\(Q_DECLARE_METATYPE(QSslConfiguration)\)://\1:' -i src/scriptbindings/generated_cpp/com_trolltech_qt_network/qtscriptshell_QNetworkReply.cpp
    
qmake -r candle.pro
make

这失败并出现以下编译错误:

camerawidget.cpp: In member function ‘void CameraWidget::setCamera(const QCameraInfo&)’:
camerawidget.cpp:88:5: error: ‘QCameraViewfinderSettings’ was not declared in this scope; did you mean ‘QCameraViewfinderPrivate’?
   88 |     QCameraViewfinderSettings fs = m_camera->viewfinderSettings();
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~
      |     QCameraViewfinderPrivate
camerawidget.cpp:89:5: error: ‘fs’ was not declared in this scope; did you mean ‘ws’?
   89 |     fs.setResolution(m_resolution);
      |     ^~
      |     ws
camerawidget.cpp:90:15: error: ‘class QCamera’ has no member named ‘setViewfinderSettings’
   90 |     m_camera->setViewfinderSettings(fs);
      |               ^~~~~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:1023: camerawidget.o] Error 1

https://doc.qt.io/qt-5/qcameraviewfindersettings.html说这QCameraViewfinderSettings是在 Qt 5.5 中添加的,所以当它声明需要 Qt 5.4.2 时,看起来 README 是错误的。

要使用的正确 Qt 版本是什么?

实验分支的构建说明是什么? #508

是的,README 的那部分最后一次更新是在 4 年前。
我使用系统上 Qt 的任何默认版本(可能是 5.11.3,因为它是基于 Debian Buster 的操作系统)。

实验分支的构建说明是什么? #508

可能缺少库,所有文档现在都很旧了。
作为参考,我使用最新的 LTS QT 5.12.11 将其构建到 OSX Big Sur。

实验分支的构建说明是什么? #508

对于较新版本的 Qt,这是可行的。@Denvi您会接受更新构建说明并修复构建脚本的拉取请求吗?

我还想添加一个在所有三个平台上编译的 github 操作,以确保它继续工作。你会为此接受 PR 吗?

另一个问题:我从 generated_cpp 文件夹中收到大约 2000 条折旧警告。哪个工具生成了其中的代码?我想知道我是否可以让该工具在构建过程中自动生成代码,以便这些文件始终与正在使用的 Qt 版本保持同步。

实验分支的构建说明是什么? #508
所有者

嗨,好的。
至于“generated_cpp”,它是https://github.com/phbaer/qtscriptgenerator

免费注册 在 GitHub 上加入此对话。已有帐户? 登录评论
标签
还没有
项目

还没有

发展

没有分支机构或拉取请求

4人参加
实验分支的构建说明是什么? #508实验分支的构建说明是什么? #508实验分支的构建说明是什么? #508实验分支的构建说明是什么? #508

喜欢 (0)