I don't think so. Do you have ui.lib file generated with ui.dll. I'm not sure if DESTDIR works with it so check in debug folder. This ui.lib is the right file to link with while compiling and ui.dll it the right file to link with in runtime. And the previous syntax was okay - I use it on both - Windows and Linux.
That's correct.main.cpp
Qt Code:
// Since this is a library, I think I should use it just like QtGui and so on, so I include necessary head files and create an instance as usual #include <QtGui/QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { MainWindow win; win.show(); return a.exec(); }To copy to clipboard, switch view to plain text mode
This file looks okay now (for library).ui.pro
Qt Code:
# also I should edit this file in order to generate a library instead of a plugin TARGET = ui TEMPLATE = lib DEFINES += UI_LIBRARY CONFIG += debug SOURCES += mainwindow.cpp HEADERS += mainwindow.h \ ui_global.h FORMS += mainwindow.ui DESTDIR = ../app/libTo copy to clipboard, switch view to plain text mode
No, it is already exported in QtGui.dll as it is part of QWidget class.mainwindow.h
Qt Code:
// OK, this is almost what QtCreator generated for me, I only added show() function in order to let Qt export this function, am I right?To copy to clipboard, switch view to plain text mode
Are you sure? You are qmaking and building test.pro or app.pro?OK, when I recompile this project, there is nothing wrong.
Open VS command prompt, go to the app dir and run:
and see what you get.
Use Dependency Walker to check library dependencies of your app.exe. And did you try also running it from outside of QtCreator just by double clicking test.exe?But I could not run it. It says that "E:\documents\test\app\debug\test.exe exited with code -1073741819" although I have copied ui.dll to the same directory of test.exe.







Reply With Quote
Bookmarks