小编Mar*_* H.的帖子

qt5 对“QApplication::QApplication(int&, char**, int)”的未定义引用

我正在尝试运行一个简单的 hello world 示例,并且已经需要一些时间来确定要使用的包含内容 现在我验证了包含路径,QApplication 实际上应该在那里,但它抛出了上述错误。为了清楚起见,我的代码:

#include <QtWidgets/QApplication>
#include <QtWidgets/QPushButton>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QPushButton *button = new QPushButton("Hello world!");
    button->show();
    return app.exec();
}
Run Code Online (Sandbox Code Playgroud)

我试图用第一编译QMAKE -project,然后QMAKE终于做出,然后得到了以下错误:

qt_hello_world.o: In function 'main':  
undefined reference to QApplication::QApplication(int&, char**, int)  
qt_hello_world.cpp: undefined reference to QPushButton::QPushButton(QString const&, QWidget*)
qt_hello_world.cpp: undefined reference to QWidget::show()  
qt_hello_world.cpp: undefined reference to QApplication::exec()  
qt_hello_world.cpp: undefined reference to QApplication::~QApplication()
qt_hello_world.cpp: undefined reference to QApplication::~QApplication()
Run Code Online (Sandbox Code Playgroud)

qmake 创建的 Makefile 包含正确的包含路径到包含 QtWidgets/QApplication 的 …

c++ qt linker-errors qt5 qapplication

7
推荐指数
1
解决办法
3211
查看次数

R 使用 $ 运算符调用多列的元素

R 中有类似的东西可以调用吗df$col1:df$col5?我想使用 将字符元素转换为数字as.numeric,因此我想做 as.numeric( df$col1:df$col5) 之类的操作将这些列中的所有元素转换为数字。

r multiple-columns

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

c++ ×1

linker-errors ×1

multiple-columns ×1

qapplication ×1

qt ×1

qt5 ×1

r ×1