My Qt built with msvc2010 does not have QtOpenGLd4.dll? - c++

Do I have to build a debug-and-release QT ? Now, with default option (-release) I see how release and debug versions are created. (###.dll /lid and ###d.dll /lib )
I’m a bit confused…. The ### files are ‘pure’ release versions and ###d. ‘pure’ debug versions ? What is the difference between this build and a ‘debug_and_release’ build ?
On release mode I can compile my app but on debug mode I have a link error: cannot find QtOpenGLd4.dll.
If I look at my /bin folder I see there is a #4.dll / #4.lib / #4d.dll /4d.lib for every qt library except QtOpenGLd4.dll. (I have only the release version ) What is happening? Any idea ?

If you configure Qt with -release it will not build debug versions of the libraries, or this is a bug in the configure app, which I really doubt is actually present.
The d suffix implies they are "pure" debug builds, and the "pure" (whatever that word would mean here) release builds are those without the suffix. Qt does not know of a ReleaseWithDebug build like CMake does, it only has the equivalent of Release and Debug.
If you only have QtOpenGLd4.dll missing and you built from source, just go to Qtbuild/src/opengl and do an nmake or nmake debug and see what happens.

Related

“Could not determine which ”make“ command to run. Check the ”make“ step in the build configuration.” Qt creator

I installed Qt Creator 5.10.1 and when I built the project I had a error : "Could not determine which ”make“ command to run. Check the ”make“ step in the build configuration.”.
I have already install Qt on another PC and I saw this question "Could not determine which "make" command to run. Check the "make" step in the build configuration." Qt creator
but in Tools > Options > Build & Run > Kits I have lot of Desktop Qt 5.10.1 so he have 1.
Sorry for my english as I'm french and I 13 so my skill is limited
https://www.dropbox.com/s/lg17a54pdgj9923/screen.png?dl=0
You can see the selected build kit in the Build Kit Selector located at the bottom left of your window (button with the hammer image).
You can also manage any of the Build Kits if you go to Tools > Options > Build & Run.
For any build kit in Qt, you need to have the following components:
Device - You can build your application or your desktop/local computer or a remote computer or device with a different or same kind of processor.
Compiler - Specify the location of a compatible C++ compiler here. Clicking on manage takes you to the Compilers tab where you can add as many compilers as you want. If you are on Windows, you will most likely have a MinGW compiler installed along with Qt at this location - C:\Qt\Tools\MinGW\bin\gcc.exe. You can also select a compiler installed with Visual Studio which will be a MSVC compiler.
Qt Version - The last thing you need to specify is the Qmake builder which is in Qt Version. You will need to select this with the appropriate C++ compiler that you previously selected in this build kit. If you have a MinGW C++ compiler, then specify a path for a MinGw qmake.exe and if it is a MSVC compiler then select a MSVC based qmake.exe. On Windows, all your qmake.exe's will be located at C:\Qt\<Qt-version>\<compiler-version&type>\bin\qmake.exe.
Keep in mind that if you are building the project for a different processor or operating system, you will need an appropriate compiler and Qmake selected.
Once you select these properly (and select that build kit in selector), your project will build properly.

Build (compile) a basic standalone .exe application using Qt-creator on Windows 8

I have installed Qt-5.7 on windows 8 because I couldn't build my released .exe from Linux (my favorite) in order to be used on Windows OS even after searching a lot on internet (Where there have to be cross-compilation...). After the installation, I just want to make sure that I can build/run a first application (one of the examples provided by default by Qt-creator "filesystembrows") and I have follow the official guide in order to build Qt as shared libraries, but the issue is that when I type the first command line I get: 'nmake' is not recognized as an internal or external command' Also it still show the same message even though a update the variable environment of the system with C:\Qt\Qt5.7.0\5.7\mingw53_32\bin which one is the default path set-up when installing Qt on windows. Any help just to make a stand alone .exe for Windows (as shared libraries ) please
Why not build your project by using qtcreator ?
Did you test your build environnement by making a test application with qtcreator ?
P.S.: If you want, I can explain how to build application using Visual Studio as a compiler and QtCreator as an IDE.
nmake is a build tool provided with Visual Studio and with Windows SDK. You don't have it, apparently.
It seems you're using a mingw build of Qt; it comes with a bundled copy of mingw. There, the build tool is simply called make.

make says: `No rule to make target` when I try to compile a Qt application for android platfrom

I wanted to compile this project for android platform. I simply downloaded it and selected all android kits after I opened the TelnetWidgetTest.pro file in Qt creator. Now the project could be compiled successfully if I choose (Android for x86 GCC4.9 Qt 5.5.0) but I got the following error when I select (Android for armeabi-v7a GCC 4.9 Qt 5.5.0):
mingw32-make: *** No rule to make target '..\..\..\..\AppData\Roaming\IDM\android-ndk-r10d\sources\cxx-stl\gnu-libstdc++\4.9\include\profile\impl\profiler_hashtable_size.h', needed by 'build\mainwindowimpl.obj'. Stop.
17:43:33: The process "C:\Qt\Qt5.5.1\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project TelnetWidgetTest (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.5.0))
When executing step "Make"
If I choose (kit: Android for armeabi (GCC 4.9, Qt 5.5.0)) It also returns the following error:
mingw32-make: *** No rule to make target '..\..\..\..\AppData\Roaming\IDM\android-ndk-r10d\sources\cxx-stl\gnu-libstdc++\4.9\include\profile\impl\profiler_map_to_unordered_map.h', needed by 'build\mainwindowimpl.obj'. Stop.
17:42:38: The process "C:\Qt\Qt5.5.1\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project TelnetWidgetTest (kit: Android for armeabi (GCC 4.9, Qt 5.5.0))
When executing step "Make"
The program could be compiled and run successfully in windows desktop.
What does it mean when make tells **No rule to make target** ? I checked the mentioned folders the files exist and path to android NDK is correct. So what the real problem is?
Another question is that, What is profiler_map_to_unordered_map.h and why it is needed by one of my object files (mainwindowimpl.obj).
Just yesterday I bumped into a similar issue. After a rather painful investigation I found that the culprit is path length!
If I create a project:
`c:\x\12345678901234567890123456789012345.pro`
which creates build directory
`c:\build-12345678901234567890123456789012345-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_0_for_Android_armv7-Debug`
(109 characters) with Android SDK in
`c:\Users\miroslav.kropacek\AppData\Local\Android\sdk`
it creates paths in Makefile like:
`..\Users\miroslav.kropacek\AppData\Local\Android\sdk\ndk-bundle\sources\cxx-stl\gnu-libstdc++\4.9\include\profile\impl\profiler_map_to_unordered_map.h`
(150 characters)
One (less comfortable) solution is to rename your project file, in my example shortening it by one character from 12345678901234567890123456789012345 to 1234567890123456789012345678901234 is enough to make it compile.
Another solution is to manually take care in Qt creator's dialog for build directories specification, and enter something less offending there (like simple "release" and "debug" directories) but you have to remember to do that every time you pull sources from scratch.
And yet another solution is copying Android SDK to C:\Android\sdk which leads to following path in Makefile:
`..\Android\sdk\ndk-bundle\sources\cxx-stl\gnu-libstdc++\4.9\include\profile\impl\profiler_map_to_unordered_map.h`
(112 characters) and works OK.
Without looking into source code I can only speculate that the culprit is mingw's make which creates a buffer 260 characters long so when the relative path is resolving, it gets as long as:
`c:\build-12345678901234567890123456789012345-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_0_for_Android_armv7-Debug\..\Users\miroslav.kropacek\AppData\Local\Android\sdk\ndk-bundle\sources\cxx-stl\gnu-libstdc++\4.9\include\profile\impl\profiler_map_to_unordered_map.h`
what happens to be exactly 260 characters and with \0 it's exactly one character beyond with infamous Windows limit.
I ran into a similar error message.
Try cleaning up the built files and then recompile it all:
Build > Clean All
Build > Run qmake
Build > Build All
Build > Run
On each step, wait for it to complete before moving on the the next one.

Why is my application searching the wrong DLL for a function?

I am writing a Qt Application using Visual Studio 2010. My application 'Review.exe' links against QtAV.dll using QtAV.lib. In turn, QtAV links against ffmpeg, portaudio, gdiplus, etc.
The debug version works correctly.
When I try and run the release version I get:
The procedure entry point GdipAlloc could not be located in the dynamic link library avcodec-54.dll.
GdipAlloc is a part of Gdiplus. Why is the wrong dll being searched for the function? This only happens in the release build.
If I replace the release version of QtAV.dll with the debug version of QtAV.dll, the release version of Review will load the debug version of QtAV.dll.
Setting the linker flag /DEBUG on the release build causes the problem to go away. However I'd like to figure out the cause and a proper solution.
I find that it does happens for vs2010. vs2012 works fine. I compile portaudio by vs2010 again(use cmake is quite easy), and generate FFmpeg .lib files by vs2010 tools, then compile QtAV again, this errors disappears!
I have uploaded new development files to build QtAV. Download FFmpeg-2.0.1_mingw32+msvc.7z and portaudio-v19_msvc2010x86_20130813.7z here: https://sourceforge.net/projects/qtav/files/depends
: )

C++ link issue after switching to /MT

I am working on application which should be running on any Windows NT machine. Today I was trying to deploy my application on new machine and suddenly get error that msvcp100.dll is missing. I've started digging into that problem and found solution. Only what I had to do is in project configurations change Run time library From /MDto Multi-threaded (/MT).
But after switching to current mode I am getting link error. Not sure why and how to fix it. Could you please help me to figure that out? Thanks!
You aren't supposed to deploy debug builds. Compile with Release settings (including release version of the run-time library) and you won't have that problem. (You can enable debug information on a release build... it's use of the debug libraries that causes problems)
The error comes from that when compiling in debug mode, you'll need to change your project to link with link with debug libraries, ie msvcmrtd.lib instead of msvcmrt.lib and msvcrtd.lib instead of msvcrt.lib
Deploying debug binaries to other machines may/will cause runtime problems though since the debug version sof the DLLs aren't (afaik) redistributable, what you probably want to do is to fix your release build.