Tag Archives: Qt5

[Solved] qt5.9 + vs2015 32bit Error: “-1: error: LNK1158: Can not Run “rc.exe”

The development platform qt5.9.0+vs2015 32bit…. After preparing to run vs2015 and installing vs2019, an error occurred when running the original program that could run

“-1: error: LNK1158: cannot run “rc.exe”

Copied the two files “rc.exe rcdll.dll” in the “C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86” directory to “C:\Program Files (x86) \Microsoft Visual Studio 12.0\VC\bin”. 

(Pay attention to the version number, because I am 32-bit so I choose X86, the reason why I choose “Microsoft Visual Studio 12.0” instead of “Microsoft Visual Studio 14.0” is that it should be in my “C:\Program Files (x86)” directory The best is “Microsoft Visual Studio 12.0”). 

Add the path C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86 to the system environment variable Path, as shown in the following figure:

 After following the above steps, the problem is solved.

How to Solve QT and PCIe interactive loading setupapi.H error

Setupapi.H relies on these header files

#include <Windows.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <strsafe.h>
#include <stdint.h>
#include <SetupAPI.h>
#include <INITGUID.H>
#include <WinIoCtl.h>
//#include <AtlBase.h>
#include <io.h>
#include "xdma_public.h"
#include "pcie_fun.h"

1. The error is reported as follows:

the loading sequence of the adjustment header file is as follows:

#include <SetupAPI.h>
#include <strsafe.h>

About to #include & lt; strsafe.h> Put #include & lt; SetupAPI.h> Just behind.

2. Then continue to report an error

because it is not linked to the setupapi.lib library
Library location: C:\program files (x86)\Microsoft SDKs\windows\v7.1a\lib\setupapi.lib

Solution: load the library into the project.

1. Create a new lib folder under the project path, copy the library to the Lib folder, and add it in the project * * *. Pro

LIBS +=  -L$$PWD/lib/  -lSetupAPI

2. A simpler way is to add directly

LIBS += -lSetupAPI

Solution to parse error at “IID” reported by QT

1. Environment

deepin v20.2.3
Qt5.14.2

2. Error log

Parse error at "IID"

3. Solutions

A lot of people on the Internet say that the supplementary constructor code is invalid after trying. Finally, it was found that the installation Qt5 private header file was missing, which was compiled after installation.

sudo apt install qtbase5-private-dev

4. Reference

Try to build QT
Qt5 plug-in file for Linux system

Qt development, using ODBC interface, query mysql, appear qsqlquery:: Value: not positioned on a valid record

Qt development, using ODBC interface, query mysql, appear qsqlquery:: Value: not positioned on a valid record

Question: in the library management system developed by QT craetor integrated development environment, the newly created database class is used to operate the database. It inherits from QObject and uses the interface provided by ODBC to connect with the database. The database is mysql5.7, When using the following query statement, we report an error:

error information: qsqlquery:: Value: not positioned on a valid record

we query the relevant information:
the solutions we have found
try according to the solutions provided in the article, the problems still exist.

Later, some information was printed in various locations, and it was found that qdebug & lt& lt; condition<& lt; content<& lt;“ The variables condition and content in “on” can be printed normally, but “on” printed out is “?”
when I thought of creating a window before, the window title set in Chinese would be garbled. The solution I found at that time was to add the following code to the. Cpp file of the corresponding class:
?Pragma execution_ character_ set("utf-8")

Solution:
add the code block as shown above to the database.cpp file:

edit test information:

test output successful:

end! Scatter flowers! Record it!

Qt5 when compiling VTK_ The solution of dir-notfound

The module Module_vtkGUISupportQt and Module_vtkViewsQt are opened, and Qt5 is used. Qt5_DIR-NOTFOUND error CMake Configure Qt5_DIR-NOTFOUND error The solution is as follows.
1. QT5 installation path
Take my computer’s QT5 installation path as an example. On my computer, Qt is installed in: E: Toolkits\Qt\Qt5.5.1.
2. VTK source file path
I am using the official release of VTK 7.0.0.rc2. Unzip the VTK source code to: E:\Toolkits\ vtk-7.0.0.rc2 \source on my computer
QT5_DIR – NotFound = QT5_DIR – NotFound = QT5_DIR – NotFound
Open the file E:\Toolkits\ vtk-7.0.0.rc2 \source\ cmMakelists.txt in line 1 of the file as follows:

cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)

Add a line of script that reads:

cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
set (CMAKE_PREFIX_PATH "E:/Toolkits/Qt/Qt5.5.1/qtbase")

Configure Generate. Configure Generate.