using dumpcpp to generated files of mstscax.dll for rdp
-
hi.
i want to write rdp application in qt project. i use dumpcpp to generated files of mstscax.dll. after that i include the .h file and .cpp file, but when i build the project, i get the errors:
LNK2019 unresolved external sysmbol. how to solve this problem ?.pro file of my project:
QT += core gui axcontainer greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = test TEMPLATE = app #TYPELIBS =$$system(dumpcpp $$PWD/rdp/mstscax.dll -o mstscax) TYPELIBS =$$PWD/rdp/mstscax.dll SOURCES += main.cpp\ mainwindow.cpp \ mstscax.cpp HEADERS += mainwindow.h \ mstscax.h FORMS += mainwindow.ui
[edit: added missing coding tags ``` SGaist]
-
Hi and welcome to devnet,
When symbols are missing it means that you are not linking to everything you need. What symbols are missing ?
-
hi,thanks for your reply.
my errors is:
mainwindow.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall MSTSCLib::MsRdpClient6NotSafeForScripting::Connect(void)" (?Connect@MsRdpClient6NotSafeForScripting@MSTSCLib@@QAEXXZ),该符号在函数 "public: __thiscall MainWindow::MainWindow(class QWidget *)" (??0MainWindow@@QAE@PAVQWidget@@@Z) 中被引用
mainwindow.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall MSTSCLib::IMsRdpClientAdvancedSettings5::SetClearTextPassword(class QString const &)" (?SetClearTextPassword@IMsRdpClientAdvancedSettings5@MSTSCLib@@QAEXABVQString@@@Z),该符号在函数 "public: __thiscall MainWindow::MainWindow(class QWidget *)" (??0MainWindow@@QAE@PAVQWidget@@@Z) 中被引用
mainwindow.obj : error LNK2019: 无法解析的外部符号 "public: class MSTSCLib::IMsRdpClientAdvancedSettings5 * __thiscall MSTSCLib::MsRdpClient6NotSafeForScripting::AdvancedSettings6(void)const " (?AdvancedSettings6@MsRdpClient6NotSafeForScripting@MSTSCLib@@QBEPAVIMsRdpClientAdvancedSettings5@2@XZ),该符号在函数 "public: __thiscall MainWindow::MainWindow(class QWidget *)" (??0MainWindow@@QAE@PAVQWidget@@@Z) 中被引用
mainwindow.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall MSTSCLib::MsRdpClient6NotSafeForScripting::SetServer(class QString const &)" (?SetServer@MsRdpClient6NotSafeForScripting@MSTSCLib@@QAEXABVQString@@@Z),该符号在函数 "public: __thiscall MainWindow::MainWindow(class QWidget *)" (??0MainWindow@@QAE@PAVQWidget@@@Z) 中被引用
mainwindow.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall MSTSCLib::MsRdpClient6NotSafeForScripting::SetUserName(class QString const &)" (?SetUserName@MsRdpClient6NotSafeForScripting@MSTSCLib@@QAEXABVQString@@@Z),该符号在函数 "public: __thiscall MainWindow::MainWindow(class QWidget *)" (??0MainWindow@@QAE@PAVQWidget@@@Z) 中被引用
debug\test.exe : fatal error LNK1120: 5 个无法解析的外部命令"无法解析的外部符号" is for unresolved external symbols in chinese.
all functions used are here:
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
//rdpWidget=new MSTSCLib::MsRdpClient6(this);
//vBox=new QVBoxLayout(this);
rdpWidget=new MsRdpClient6NotSafeForScripting(this);
rdpWidget->show();
//vBox->addWidget(rdpWidget);
rdpWidget->SetUserName("username");
rdpWidget->SetServer("ip");
rdpWidget->AdvancedSettings6()->SetClearTextPassword("123");
rdpWidget->Connect();}
-
The question might be silly but did you check that everything is built correctly ?
-
Hi, the reason you get Link errors is because those methods are not callable that way, instead, you have to use COM.
Qt has very good support for using COM, easiest is to first test with a QAxWidget:Go to the designer and add a QAxWidget (if you haven't done so already).
Double click on it to get the dialog box "Select ActiveX control".
Select "Microsoft Terminal Services Client Control - version 1" and click OK.
(Also you need to includeaxcontainer
in your .pro file but I see that you have already done that.)Now you can set/get the properties, either in the designer or with C++ code like this:
ui->axWidget->setProperty("Server","ip");
qDebug() << ui->axWidget->property("Server");
To connect:
ui->axWidget->dynamicCall("Connect()");
Now you should see your server in the widget's window, good luck!
-
@hskoglund thanks. i understand using com object and i have implemented that way. but in that way, i think not all functions can be used. this website rdp in qt illustrates how to realize in qt. i think the reason why my project is not correct is the wrong configuration, but i dont know how to solve it.
-
@SGaist thanks, all functions in my .h file have been implemented. may be it is not the problem of symbols. thanks anyway. if it is convenient for you, i can post my source code.
-