Qt里QAxObject应该如何用
Qt里QAxObject应该怎么用上代码#include QtCore/QCoreApplication#include QAxObject#include window
Qt里QAxObject应该怎么用
上代码
#include <QtCore/QCoreApplication>
#include <QAxObject>
#include <windows.h>
int main(int argc, char *argv[])
{
//OleInitialize(0);
//CoInitialize(0);
QCoreApplication a(argc, argv);
QAxObject *asdfg = new QAxObject("Excel.Application");
return a.exec();
}
提示C:\Documents and Settings\Administrator\111111111\main.cpp:9: 错误:undefined reference to `QAxObject::QAxObject(QString const&, QObject*)'
:-1: 错误:collect2: ld returned 1 exit status
而QAxObject构造有这一项 QAxObject(const QString &c, QObject *parent = 0);
上面两行//OleInitialize(0);
//CoInitialize(0); 加不加都报错,翻译报错。 Qt QAxObject
[解决办法]http://blog.csdn.net/yangxiao_0203/article/details/7422715