dumpbin equivalent in Qt - qt

Is there any utility similar to dumpbin(Visual Studio) in Qt that allows me to check the functions that are exposed in a Qt-Creator compiled dll ??
I need to know what methods are exposed in a given dll so that I can load the method dynamically at runtime using QLibrary.
Thanks,
De Costo

You can use Dependency Walker. It is a very useful tool for any executable file, whether it's a dynamic library or an application.
Also, nothing prevents you from compiling with VC++ in Qt Creator (Qt Creator supports GCC and VC++ as compilers, maybe more) and using dumpbin, too.

On Linux and Mac, use nm
On Windows, you can use nm via Cygwin, but I think dumpbin will still work. (I just tried it on a project compiled with g++ via Qt Creator, and it worked.)

Either:
use an existing MS Visual Studio installation and its dumpbin.exe
install the Windows SDK (only the Win32 dev tools) and use its dumpbin.exe
learn to use the mingw/GCC (actually binutils) nm and objdump.
I find that (even with mingw/gcc) the dumpbin.exe provides the best results.

Related

QT 5.11 macdeployqt mingw not installed by default?

I do not have the macdeployqt installed on Windows 10 alongside of the windeployqt tool. Nothing relevant or useful appears when searching about this issue so I'm forced to resort to stackoverflow.
windeployqt works fine, however the macdeployqt tool is not there. Is there a way to download the tool from somewhere possibly via the presently non working maintenance tool (due to the default repositories not working for me on QT5.11)?
The macdeploy tool's source code is shipped with Qt sources (qt-src\qttools\src\macdeployqt). Most of it's source code is within #ifdef Q_OS_DARWIN-blocks, and it's linked against Apple's CoreFoundation Framework, so I don't think you will ever get the macdeploy-tool to work on windows. Im curious how you compiled your application that you're trying to bundle; afaik you cannot cross-compile in a meaningful way as the CoreFoundation and other Mac-Frameworks are not available on any other platform.

Using Qt and cmake to store static files into /usr/share

I use Qt and cmake for my open source application, which is targeted at Windows and Linux currently. It is written in C++. Tarballs and debian packages can be generated using cmake, while InnoSetup is used for generating Windows setup packages.
I know Qt has QSettings for storing user-specific persistent data and is cross platform. I'm not asking about this.
I have some architecture-independent, purely static, non-user-specific data (basically some XML files that never change) which I want to install together with my executables.
From what I understand, in Linux, this should be installed into /usr/share/[application] or /usr/local/share/[application]. OTOH, in Windows, this should be installed in C:\Program Files\[application].
How do I use the install command in cmake to achieve this for Linux?
Does Qt have any cross-platform API to auto-detect the location of these files after installation, just like it does for QSettings?
I can't answer #1, but maybe QStandardPaths is what you're looking for for #2?

Qt SDK download for MingW

I´m looking for Qt SDK for windows that uses MingW as the compiler. Unfortunately, on the official download sites, I can only find the one that uses MSVC. Or just the library instead of the whole SDK.
Can anybody tell me where I can find the version I am looking for, or explain what I should do if I download QT library, QT creator and MingW seperately?
Here you can find pre-release builds using MinGW 4.7.
http://releases.qt-project.org/digia/5.0.1/latest/
They work well with the MinGW builds distributed here:
http://sourceforge.net/projects/mingwbuilds/
The Qt builds come with Qt Creator, so you can install it and should be good to go after setting up your kits.
You can find binaries here:
http://qt-project.org/forums/viewthread/23002/
But then you ought to reconfigure installation manual or you may use this utility.
Some guy from Digia promised MinGW builds by the end of January, so you can wait instead.

How to force Qt Creator to use MinGW instead of Visual Studio

We're trying to compile a project with MinGW on the machine that has both MinGW (with Qt) and Visual Studio installed. Unfortunately, Qt creator prefers MSVS by default, and doesn't see it's very own MinGW (screenshot). Sadly, this results in a lot of obscure errors, because application was written and debugged with MinGW. Is there way to make Qt Creator to use MinGW without killing MSVS?
While installing, choose custom type of installation. Selected libraries for needed compilers in QtSDK->Development Tools->Desktop Qt->Qt-. Screenshot:
Have you made sure your Qt sdk is installed with its MinGW? You can use the Qt maintainance app to make sure its MinGW engine is installed.
Where are those libraries from? Did you compile the SDK yourself? Or did you downloded the libraries?
Try to see what is in the mkspecs directory. There should be a link named 'default'. That links to the specification which is being used. I suppose it is pointing to win32-msvc2008. You can change that but if it is pointing to that specification it means that the Qt libraries have been compiled with that specification (unless it was changed afterwards), which means you cannot use those with MinGW. You should compile the libraries with the correct specification or download the correct package (MinGW version).

How to install two versions of Qt and tell the application which to use?

I am developing an application in Qt, but using D language (with QtD binding). I've noticed that my app crashes with Qt 4.7.x, so I need to use Qt 4.6.2 instead. However in my system Qt 4.7.2 is installed. Unfortunately I neither make QtD work with the latest Qt versions nor (I'm afraid) count on QtD developers...
The only thing I need to make my application install in system Qt 4.6.2 libs and use it, but let all the other applications still use Qt 4.7.2. Is it possible? If it is, how to do it then?
The answer to your question is the version of Qt is determined by the qmake you use to generate your Makefile.
/opt/QtSDK/Qt-4.6.2/bin/qmake
/opt/QtSDK/Qt-4.7.3/bin/qmake
Each will use the library in the directory.
It is possible to install several versions of the library into one system, and all package managers (rpm, deb) support this out of the box.
These libraries will be just differently named. For example, if id do
ls /usr/lib/ | grep libcurl
on my system, I'll get:
libcurl-gnutls.so.3
libcurl-gnutls.so.4
libcurl-gnutls.so.4.2.0
libcurl.so.3
libcurl.so.4
libcurl.so.4.2.0
, so, different version of the same library happily live together.
All you need to do is to link against the desired version of QT library. You need to sepcify it in linker options (don't remember the exact option).

Resources