I am currently trying to compile a Qt application that I downloaded from github on my windows machine. I did not have any trouble compiling this on Ubuntu so I was hoping someone could help shed some light on my problem.
I am using Qt-Creator to compile the program.
The exact error messages are:
:-1: error: cannot find -lQt5Guid
:-1: error: cannot find -lQt5Cored
collect2.exe:-1: error: error: ld returned 1 exit status
My first idea when reading those messages was that the windows PATH variable does not include the locations of the libraries. But when I checked, my PATH contained the following:
C:\Qt\Qt5.1.0\5.1.0\mingw48_32\bin;C:\Qt\Qt5.1.0\Tools\mingw48_32\bin;...
Which exists and contains what looks like the correct Dlls.
I am using MingGW rather than the visual studio compiler (although i have it available if needs be).
How can I fix this error and what could be causing it?
EDIT: When I run qmake there does not seem to be any problem. The errors come up when I try to build the project.
Cored is a fundimental part of Qt so it looks like the linker can't see any of the Qt libraries.
Did you install Qt 5.1.0 SDK?
A few things to check:
Do you have a line like this in your .pro file?:
QT += core
You mentioned "Projects section my path" are you talking about the windows PATH variable? these paths should also be in that. You can check with dos command:
echo %PATH%
If these paths are not there, for a test, add them in if this works then something has gone wrong with the local PATH setup (i.e. when running qt creator - if you are using qt creator?)
Finally just check that the debug version of the Qt5Cored.dll exists in that folder (C:\Qt\Qt5.1.0\5.1.0\mingw48_32\bin) because it looks like you are building a debug build (which is why your program is looking for 'd' post-fixed name Qt5Cored and not Qt5Core).
Related
I've been spending almost all day trying to get QT installed on my windows machine. I have installed QTCreator with QT 5.14.1 and QWT 6.1.3 (have also tried 6.2.0) and following these instructions with QWT: https://qwt.sourceforge.io/qwtinstall.html
Everything goes fine until I get to the same point where after running nmake it prints:
qwt.cpp
..\..\..\Qt\Qt5.14.2\5.14.2\msvc2017_64\include\QtCore\qglobal.h(45) : fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
qwt_abstract_scale_draw.cpp
..\..\..\Qt\Qt5.14.2\5.14.2\msvc2017_64\include\QtCore\qglobal.h(45) : fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
qwt_bezier.cpp
..\..\..\Qt\Qt5.14.2\5.14.2\msvc2017_64\include\QtCore\qglobal.h(45) : fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
My path variables show that the include directory where type_traits exists is most definitely there.
Any pointers would be great. I'm not sure what else I can possibly do. I've uninstalled and reinstalled my entire .net framework, same with QT.
I ended up solving this, and it turned out to be an issue with the compilers I was selecting. I figure this could help people down the line so I will post what I documented on my company portal - the instructions I have written are as follows:
=====
Realistically, it doesn't matter which kit you select, as long as the compiler and QT version is set up correctly. What will indicate a correct kit setup is the display of a monitor logo at the label.
Configure a kit by first selecting it as default
C and C++ Compiler -> ''Microsoft Visual C++ Compiler 15.9.xxxx''
Compiler version 15.9.xxxx is a part of Microsoft Visual Studio 2017. If you cannot find this compiler in the drop down box, it is most likely because you are missing the 2017 install. Download the BUILD TOOLS and REDIST PACKAGE from here.
Debugger -> ''C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\cdb.exe''
If you can't find the debugger, it means you are missing the Windows 10 SDK. [[https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/|Download from here]].
QT Version -> ''Qt 5.14.1 MSVC 2017 32bit''
CMake generator (not sure how important this is, but it seems to make the compile run): Ninja
I have made the appropriate modification as found in this thread to enable the Qt sqlite plugin to load extensions. However, when I run SELECT load_extension('spatialite_mod'), I now get the error The specified module could not be found
On a Windows Qt installation, where do I need to put the spatialite_mod.dll file so that it can be found a runtime? I have already tried putting it in the binary directory without any success.
This turned out to be a multi-part problem.
The answer to the original question is that Qt looks for the libraries in the working directory (QDir::currentPath()) and in the Windows PATH.
Part 1:
On Windows, the specified module could not be found error also can mean that one of mod_spatialite.dll dependencies was not found. In my case, I had forgotten to move these dependencies to the same directory as mod_spatialite.dll. They include:
libgcc_s_dw2-1.dll
libstdc++-6.dll
libsqlite3-0.dll
libxml2-2.dll
zlib1.dll
libfreexl-1.dll
libgeos_c-1.dll
libgeos-3-5-0.dll
libiconv-2.dll
liblzma-5.cll
libproj-9.dll
Part 2:
The libgcc_s_dw2-1.dll and libstdc++-6.dll libraries shipped with libspatialite do not work with Windows 10. Read more about this here and here. They would crash the program when loaded. The fix for me was to grab the same libraries from my Qt installation at C:\Qt\5.11.3\mingw53_32.
I downloaded Qt5.6 VS2013 32bit and try to run the official example of QtWebEngine.
I just followed the instruction but
When linking it gives out an error of
LNK1104 file not found c:\Users\qt\work\install\lib\Qt5Widgetsd.lib.
However, I have no idea of where this path c:\Users\qt\work\install\lib\ comes from.
I did text search in all directories of example folder and no hits other than generated files(makefiles and pdbs).
I also checked system environment variables but no hits.
Furthermore, I checked Qt Creator'r Projects panel and its Build Environment and still no hits.
Did I miss something?
P.S. this error was given out by linking DemoBrowser example of QtWebEngineWidgets pro
The link is generated by qmake when it generates the build scrip from the qt project file (*.pro). It is based from the qmake application path that is generaly installed together with the libraries (check you qt kit setup to change it if needed: Jst browse to qmake.exe application).
Then try regenerate the build script. It should fix the issue.
You may also have issue with installation not being in debug mode; you are trying to use Qt5Widgetsd.lib library instead of the non-debug one Qt5Widgets.lib
I'm trying to write Qt3D application in windows. I'm getting an error when i trying to compile the program and run it. the error's message is : 'The procedure entry point ??4QImage##AEAAV0#$$QAV0##Z could not be found in the dynamic link library QtGui4.dll'.
my compiler is Microsoft Visual C++ 9.0 and Qt version is 4.8.1.
is there any solution for this?
Do you face the problem in both running from the IDE and standalone exe, and both in debug and release mode. IF some of these work, make sure proper QtGui4.dll is copied to the same path where your executable is getting generated.
I am trying to build a program using the command scons compiler = msvc. During this action a link error appears: LNK1181: cannot open input file 'QtCore4.lib'. I have installed Qt for Windows from http://qt.nokia.com/downloads (the free version) and tried to find the requested lib file, but only found the same dll file.
Any advice on how to proceed would be most appreciated.
It seems I have built Ot using debug option. Without it creates all the necessary libraries.