我正在尝试运行一个简单的 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 的 …
R 中有类似的东西可以调用吗df$col1:df$col5?我想使用 将字符元素转换为数字as.numeric,因此我想做 as.numeric( df$col1:df$col5) 之类的操作将这些列中的所有元素转换为数字。