Yeah, I am wondering is there anything like that? Normally a static lib will be Console based, but what I need is a GUI library for suppose a HelloWorld MessageBox when I call helloworld() func in a console application.
Straight to the point, I need to integrate one GUI library (may be plugin - if plugin its a .dll right? OK anyway) in a Console Application.
I've tried looking at Qt4 Plugin creation but I think its only for Qt based applications? Please provide any links for my requirement. Thanks ...
You'll have to compile your GUI libraries into a static library. That doesn't have anything at all to do with console or non-console applications.
Then, if you link your application with that, you get what you desire. But don't be surprised about the file size of your resulting program.
Related
I have written windows gui application using qt and i want to deploy it.Now when i place .exe to other PC it shows error which says that qt5core.dll and etc required.I can install this dll,but is it possible to run exe app with qt without qt's dll as one file?So i can for example give .exe to my friend and he can instantly run it without installing .dll?
Basically, if you want a single exe file, you probably mean static linking.
The legal commercial version makes it possible or if I am not wrong, you will have to build a static qt version.
In the latter case, you will have to provide the source code of your application.
I do this sometimes, but you'll have to be careful with the license requirements: if you go with GPL, it should be OK, if you choose LGPL, it may be a bit less simple. No idea about the commercial version.
What you must do is building Qt statically, and then use that Qt build to build your application. I had a good experience with mxe. MXE builds an entire crossbuild environment and allows you to build your big Qt exe statically. I used it on Mac OS and Linux to build static executables for Windows, but you can probably run it on WSL. It takes a bit to compile, but it is simple to use. Please note that it cannot be used if your app needs QtWebEngine as it won't build with mingw.
Another simpler option is to create an installer. The Qt installer framework is simple to use. If you include the VS runtime, you end up with a single exe to distribute (the installer).
You always need to include the libraries you use (including your compilers runtime libraries in fact) when you deploy your executable - otherwise how would your application be able to use the code in those libraries? You may be able to statically link some/most things, but rarely everything. Look into how to create an installer / package for your application, so you can bundle up everything as one convenient file.
You can buid you app using QT Static (a large .exe file, no external dependencies)
If you are using LGPL Qt, you must read this:
https://www.qt.io/faq/3.7.-what-are-my-obligations-when-using-qt-under-the-lgpl
Yo can use Qt and static linking, but "The user of your application has to be able to re-link your application against a different or modified version of the Qt library"
You can use an application template like this, very useful for LGPL Qt:
https://marketplace.qt.io/products/qt-lgpl-app-template
I have a server written in Qt (primarily because I need to use the Qt encryption package) and I want to port it to iOS. I've checked out the Qt4iOS project, and I am able to compile my server into a .a library. However, I still want to use the native Cocoa Touch (Obj-C) interface of the app. I just want to be able to start the server from the app and use it.
I'm not terribly sure how to do that... Should I just call the qt_main function (converted from the main function by Qt4iOS) within my ViewController? Qt4iOS has instruction for apps that are completely Qt. You link the .a file and remove everything else and it will work. But what if I don't use Qt GUI?
Many thanks!
So im a bit confused by what to-do with this current pop-up im having from QT. Not entirely sure what it means.
So i'm trying to create a C++ Library, as a static linked library. Currently the library has no code in it whatsoever.
Immediately hitting the build button to make sure everything runs fine the following pop-up below is displayed.
Im not sure what this means exactly. Or indeed, why it is even being shown in the first place. building any of my other project files works fine without issue. But this does not.
.
As for what i have, i am using the Qt SDK, version 4.8.1.
Any help solving this issue would be greatly appreciated :).
A library [usually] needs to be invoked from an executable - The dialog box you are seeing is asking you to specify an executable that will bring your library into life and call functions within it.
You need to write a client executable (or use an existing executable) to use your library and specify the path in this dialog box.
The button you clicked was probably the Run button:
, not the build button: .
I need to create a windows DLL that exports functions and has a graphical user interface. The reason for the GUI in the DLL is that the DLL serves as a kind of plugin for another 3rd party application. Currently I only have access to Visual Studio Express which AFAIK doesn't support MFC so I'm looking for alternative ways to create a GUI in a DLL. After some research I came across Qt which seems promising. And it seems like it might be easier to just use the Qt Creator IDE rather than Visual Studio Express.
However, how do I create a windows DLL in Qt Creator? (I guess a regular DLL, I don't think a COM or managed DLL will work)
UPDATE:
I got this working! After jumping through several hoops, two important keys were to add
#include <windows.h>
And then to use the Qt/MFC Migration Framework tool (currently officially available at: http://qt.gitorious.org/qt-solutions/qt-solutions/trees/master/qtwinmigrate EDIT: I believe this is the new link: https://github.com/qtproject/qt-solutions/tree/master/qtwinmigrate)
I used this example to get me going:
http://doc.qt.nokia.com/solutions/4/qtwinmigrate/winmigrate-qt-dll-example.html
EDIT: I believe this is the new link http://htmlpreview.github.io/?https://github.com/qtproject/qt-solutions/blob/master/qtwinmigrate/doc/html/winmigrate-qt-dll-example.html
Add the folowing line to the .pro file: TEMPLATE = lib
That's just about all you'll have to do to have QtCreator make your 'app' into a dll.
check qt plugins http://cartan.cas.suffolk.edu/qtdocs/plugins-howto.html
I'm going to create a utility with GUI that will run on Windows operating systems.
It should require minimum (or zero!) amount of additional libraries, files or DLLs to run because it will be executed from an installer. Because of this, i don't want to use .NET for it will require user to install .NET Framework. I know today, most of Windows installed system come with .NET Framework but in my case i cannot be sure.
The utility will...
send some data to a web site and
parse the returning data,
collect some hardware info, like MAC address,
CPU type and make, hard-disk serial
number
I suppose native Win32 API could be used for all of those above, but instead of hassling with Win32, i'd prefer using a more developer friendly API, or SDK.
Thanks in advance.
Win32 API is the only way, and of course there are standard API - for sending data over the internet, you could use WinInet.lib/dll, to obtain information about the MAC, you could use the GetAdaptersInfo by using Iphlpapi.lib/dll,(here's a link on how to use it) for the Hard disk serial number you could use GetVolumeInformation by using kernel32.lib/dll. For the CPU Id, you might look into GetSystemInfomation
Edit: There's a C++ code, but you can easily derive a wrapper from this site Unfortunately, with WinAPI is not easy, no such thing as RAD with WinAPI but what you gain out of it is lightweight code instead of relying on SDK's, frameworks and dragging buggy dll's around with your application.
Hope this helps,
Best regards,
Tom.
You can statically link most C++ GUI libraries - even MFC. Personally, I recommend WTL, wihich is very light and header-only.
If what you want is minimum dependency with external files or DLLs you could statically compile all the required DLLs with the tool exe. Then you could use something like Visual C++ to develop such tool.
WTL is perfect for this sort of application and I am surprised more people aren't recommending it. You can also statically link with the CRT and hey presto - no dependencies and a very small EXE.
Delphi (now by Embarcadero) would do the job, creating a .exe file with no dependencies, and it is much easier to work with than the raw Win32 API.
If you don't like Object Pascal, you could try C++ Builder instead.
For the GUI you can either build your application with MFC (statically linked) or use a HTML based dialog that you can interact with using COM. (It is even possible to interact with javascript present in the page displayed by the dialog).
For the specific requirement that you do have, I feel Win32 API is the only way out.
Use MFC and statically link to it. No runtime dependancies need to be installed.