1

Topic: Application DLL in composition Qt of projects

Good afternoon, dear colleagues! Whether it is possible in projects on Qt to apply units in the form of DLL? I will explain this point in question: I would like to make the unit of my application (for example - for a data sampling of a DB) in the form of DLL. To apply it in various my projects. In the form of DLL, instead of a plug-in. With plug-ins - all question already successfully dared: http://rsdn.org/forum/cpp.qt/6676064 the Author: AlexGin Date: 24.01.17 In other words - all loading  is incurred by library Qt. I suppose that in Qt there is a support of this functional, at least, not worse, than it is in MFC Thus important that through the interface application-DLL I could transfer data types as POD, and objects of classes Qt. Prompt, please, in what direction to dig?

2

Re: Application DLL in composition Qt of projects

Hello, AlexGin, you wrote: AG> Prompt, please, in what direction to dig? QtWinMigration

3

Re: Application DLL in composition Qt of projects

Hello, Qt-Coder, you wrote: QC> QtWinMigration Is not present, it at all that. I after all do not migrate with MFC (I simply resulted MFC as a library example where selection of a part of the code of the project in DLL is implemented). All project - while in the form of uniform EXE the unit, but it would be desirable to break it on DLL (that ).

4

Re: Application DLL in composition Qt of projects

Hello, AlexGin, you wrote: AG> All project - while in the form of uniform EXE the unit, but it would be desirable to break it on DLL (that ). What hinders simply to make an exported class? lib from dll to add in the project.

5

Re: Application DLL in composition Qt of projects

Hello, AlexGin, you wrote: AG> Good afternoon, dear colleagues! Whether AG> it is possible in projects on Qt to apply units in the form of DLL? AG> I Will explain this point in question: I would like to make the unit of my application (for example - for a data sampling of a DB) in the form of DLL. To apply it in various my projects. AG> in the form of DLL, instead of a plug-in. AG> with plug-ins - all question already successfully dared: http://rsdn.org/forum/cpp.qt/6676064 the Author: AlexGin Date: 24.01.17 AG> In other words - all loading  is incurred by library Qt. AG> I suppose that in Qt there is a support of this functional, at least, not worse, than it is in MFC AG> Thus important that through the interface application-DLL I could transfer data types as POD, and objects of classes Qt. AG> Prompt, please, in what direction to dig? If you want simply in run-time to load units, 0 interface QLibrary: http://doc.qt.io/qt-5/qlibrary.htm If you want  this unit statically that it is a question on a used development environment and type of files of the project (qmake / cmake / qbs / Visual Studio projects/...). For example, if it is used qmake it is necessary to write my_lib.pri about following contents: INCLUDEPATH * = C:/my_lib/include DEPENDPATH * = C:/my_lib/include win32 {CONFIG (release, debug|release): LIBS * = C:/my_lib/lib/my_lib.lib CONFIG (debug, debug|release): LIBS * = C:/my_lib/lib.debug/my_lib.lib} It is possible to use $$ PWD if in your scenario of usage it is more convenient to write the relative ways. In projects which use me_lib, we write: include (C:/my_lib/my_lib.pri) the Alternative variant: we Write my_lib.prf (the content similar my_lib.pri), but we put it in %QTDIR %\mkspecs\features\In files of projects, instead of include, we write CONFIG * = my_lib.