MSVC2013 - Entry Point Not Found - c++

I recently installed the Qt add-inn for visual studio 2013. When I build a project in either Qt Creator or Visual Studio using MSVC2013 it builds without errors, but can only be run from inside the IDE. If I try to run it by clicking the .exe, it gives an error: "The procedure entry point ?qt_metacast#QMenuBar##UAEPAXPBD#Z could not be located in the dynamic link library".
From the research I have done online, I found that it could be something to do about adding the correct .dll files in my .exe directory. Which .dll files do I need or is there something else I'm doing wrong?
I installed the Visual Studio Add-in 1.2.4 for Qt5 from the Qt website.

DLLs for this kind of libraries use to be unnecessarily big. You should make a Qt static compilation so that your needed functions are embed into your *.exe.

Related

Visual Studio c++ dll not found

I am trying to link my .exe file to a .dll in visual studio but I don't understand how (I am using VS2019).
I have looked at this question here but it only provides half the solution. I went to project properties->debugging->Environment and added PATH=LOCATION_OF_MY_DLL and this works when I run the program in the IDE, but when I manually run the .exe it gives the same error that the dll was not found (it is only fixed if I copy the dll to the exe location).
In addition, I am managing the entire project using premake so is there a way to add these setting in there as well?

Qt5 create an exe file

I'm trying to create a Qt5 executable on Windows, when I built the project from QtCreator and went to the build folder and started the .exe I received a lot of missing library errors, and I fixed it using windeployqt:
>C:\Qt\5.15.2\msvc2019_64\bin\windeployqt.exe App.exe
Then I had another problem:
The application was unable to start correctly (0xc000007b).
And I simply solved it by installing Visual C++ Redistributable Packages for Visual Studio 2013. But now if I try to start it it gives me an error:
The code execution cannot continue because libwinpthread-1.dll was not found.
Does anyone know how to fix it? Thank you.
There's a description for this process (which is called deployment) in the Qt manual, e.g deployment with windeployqt, you might also look at the Qt Wiki for manual deployment.
BUT: It looks as though you mixed up something in you application: Visual C++ Redistributable Packages are needed in case you compile your application with Microsoft compilers. libwinpthread-1.dll is needed in case you compile your application with mingw compiler.
Make sure that you are using the same compiler/linker for all libraries, sources and the pre-built binaries from Qt.

How to fix error MSVCP120D.dll in Visual Studio 2015?

Hello I have downloaded and unzipped OpenCV-2.4.10.exe on my PC. Then created a new Win32 Console application project in VS 2015, set all the Paths in Project properties, set the environmental variables in Win8.1. When I'm trying to start the program in debugging mode I get the "The program can't start because MSVCP120D.dll is missing from your computer. Try reinstalling the program to fix this problem".
Then, I downloaded the Visual C++ redistributable for Visual Studio 2015 But the problem still remains. What should I do to use OpenCV in VS 2015?
OpenCV-2.4.10.exe comes with runtime binary dlls built to work with runtimes from vc10 (vs2010), vc11 (vs2012) and vc12 (vs2013).
These DLL files use MSVCP100.dll, MSVCP110.dll and MSVCP120.dll respectively, and if you have installed Visual Studio 2015 you should find them in your System32 (or SysWOW64) directory.
The MSVCP120D.dll error appears when your application tries to load the DEBUG version of the DLL binaries. You do not have MSVCP120D.dll unless you have Visual Studio 2013 installed on your system. To solve this problem, use the Release runtime instead of the Debug runtime.
All you need to do is exclude the DEBUG lib files from your project. This means including only the lib files without the suffix 'd'. (ie. include opencv_core2410.lib instead of opencv_core2410d.lib)
HTH
Extras:
You don't really need to load the Debug binaries, unless you need to debug openCV's source code. If you do, there's still a way. Download the openCV source code, use CMake to create a VS2015 project. You can then build your own dll binaries using the latest runtime from VS2015.
VS2015 uses vc14 while OpenCV2.4.10 doesn't come with pre-built binaries associated with vc14. This answer should help you to understand. Accordingly you should choose the right folder (vc14) for Linker>General>Additional Library Directories in project properties.
You can use cmake to build binaries using VS2015 or you can download a later version of OpenCV which has prebuilt binaries for vc14.

My Qt5 executable does not run outside of Visual Studio 2010

I have done a big project with Qt5 and visual Studio 2010. Everything is well inside of visual studio using the run button.
But my goal is of course to release it to other persons, without visual studio.
My problem is: I can't get the .exe run outside of visual studio. I was asked for several dll's at first, I found them all in the Qt5 bin folder.
But know I got rid of those messages, when I wan't to open my exe, nothing happens.
Just nothing.....
I cannot even find my exe in the windows task manager.
Does someone here know an answer to that issue?
There are dll files that are loaded during runtime and don't give you any error, warning or whatsoever when not present (also totally transparent to dependency walker). Such is the platforms\qwindows.dll - note that it must be in a platforms\ subfolder relative to the executable. You might also be missing libEGL.dll and libGLESv2.dll.
Dependency Walker is not very useful in this case as it shows very strange dll files missing: API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL etc.
You can use Qt5.x cmd prompt ( 5.x is the version that you are using) and run windeployqt.exe from your build directory. It will automatically find and copy all necessary dll files to your output directory.

How to generate Qt .pri files from Visual studio project at the end of the build?

Can I setup my solution in visual studio to automatically generate the .pri files at the end of the build? I thought about perhaps writing a batch file to call a command to generate the .pri files, is it possible to generate .pri files from the command line?
I am working on a Qt C++ application in visual studio made up of 9 subprojects. I also created a QMake based build of the same application using Qt visual studio add in to generate the .pro and .pri files.
The setup is working well, and the application compiles successfully on Windows (using VS2010) and Mac OS X (Qt creator). The problem is that every time I change the projects in visual studio (for example by adding or removing source files), I have to manually regenerate the .pri file for the project so it gets picked up by qmake.
I'm using the Qt visual studio add in v1.1.11. Visual studio 2010, Qt 4.7.4.
I created a small python script to generate .pri files from visual studio .vcxproj.filter files, I've added it to our post build script that runs at the end of the visual studio build, and it seems to work quite well. If anyone else wants it, you can find it here:
https://github.com/JamesSmaldon/prigen.git
You know, Visual Studio is independent on Qt environment. The only opportunity to do what you want is use of some VS plugins, but I've never actually seen such an option anywhere.
As for me, when I add some file to VS solution, I append it manually to the *.pro file.