gpt4 book ai didi

linux - 在 openSUSE 下编译 QtProject 时出错

转载 作者:太空宇宙 更新时间:2023-11-04 12:20:47 25 4
gpt4 key购买 nike

我尝试使用 CMAKE 生成 makefile 在 openSUSE 下编译我的项目。

现在,我遇到了这个错误。有人可以帮我吗?

[ 18%] Building CXX object VSProjects/PROJECT/CMakeFiles/PROJECT.dir/src/Activity/ActivityFactory.cpp.o
In file included from /home/martin/Qt/5.8/gcc_64/include/QtCore/qglobal.h:97:0,
from /home/martin/Qt/5.8/gcc_64/include/QtCore/qchar.h:43,
from /home/martin/Qt/5.8/gcc_64/include/QtCore/qstring.h:48,
from /home/martin/Qt/5.8/gcc_64/include/QtCore/QString:1,
from /home/martin/VSProjects/PROJECT/src/Activity/ActivityFactory.cpp:51:
/home/martin/Qt/5.8/gcc_64/include/QtCore/qglobal.h:357:1: error: expected constructor, destructor, or type conversion before ‘(’ token
Q_CORE_EXPORT const char *qVersion() Q_DECL_NOTHROW;
^
/home/martin/Qt/5.8/gcc_64/include/QtCore/qglobal.h:649:12: error: expected constructor, destructor, or type conversion before ‘(’ token
Q_NORETURN Q_CORE_EXPORT void qTerminate() Q_DECL_NOTHROW;
^
/home/martin/Qt/5.8/gcc_64/include/QtCore/qglobal.h:657:1: error: expected constructor, destructor, or type conversion before ‘(’ token
Q_CORE_EXPORT bool qSharedBuild() Q_DECL_NOTHROW;
^
/home/martin/Qt/5.8/gcc_64/include/QtCore/qglobal.h:697:1: error: expected constructor, destructor, or type conversion before ‘(’ token
Q_CORE_EXPORT QString qt_error_string(int errorCode = -1);
^
/home/martin/Qt/5.8/gcc_64/include/QtCore/qglobal.h:702:1: error: expected constructor, destructor, or type conversion before ‘(’ token
Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line) Q_DECL_NOTHROW;
^
/home/martin/Qt/5.8/gcc_64/include/QtCore/qglobal.h:719:1: error: expected constructor, destructor, or type conversion before ‘(’ token
Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *file, int line) Q_DECL_NOTHROW;
^
/home/martin/Qt/5.8/gcc_64/include/QtCore/qglobal.h:750:1: error: expected constructor, destructor, or type conversion before ‘(’ token
Q_CORE_EXPORT void qt_check_pointer(const char *, int);
^
/home/martin/Qt/5.8/gcc_64/include/QtCore/qglobal.h:751:1: error: expected constructor, destructor, or type conversion before ‘(’ token
Q_CORE_EXPORT void qBadAlloc();

最佳答案

我深入研究了 CMakeLists.txt 并发现,一位同事已将 -DWIN64 添加到编译器标志。

Qt 知道它在 Windows 下编译并添加了“Q_OS_WIN”定义

现在 Q_CORE_EXPORT 正在寻找 __declspec 宏...

关于linux - 在 openSUSE 下编译 QtProject 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46069083/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com