Tag Archives: qt

[Solved] error C4996: QString::SkipEmptyParts declaration has been rejected

Recently upgraded QT version from Qt5 12.9 upgrade to qt5.0 15.2. There are several errors in compilation, one of which is error c4996: qstring:: skipemptyparts. The declaration has been rejected.

It is found that Qt5 In versions after 14, QString::SkipEmptyParts has been moved to Qt::SkipEmptyParts.

After modifying QString::SkipEmptyParts to Qt::SkipEmptyParts in the code, the compilation passes and the problem is solved.

[Solved] QT Compile Error: nmake: fatal error u1077

One possibility is that the installation path of VS is not added to the environment variable
an error is reported:
nmake 👎 Error: u1077: “D:\program files (x86)\Microsoft Visual Studio 14.0\VC\bin\AMD64\link.Exe”: return code “0x486”

Solution:

Add to the environment variable:

D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN

[Solved] Fatal error LNK1169: one or more multiple defined symbols were found

Declare the global variable. The global function must be declared in CPP. If other classes refer to the global variable, include the H file of the CPP, and then extern. Otherwise, the repeated definition error is likely to occur.

How does this “easy” explain?

For example, if a global variable is declared in A.H

int Global;

In B.H

include "A.h"
.....
extern int Global;
......

If you include A.H, it is equivalent to including the declaration of global variables in A.H, and the compiler will consider it a duplicate definition.

Therefore, global variables and function declarations must be in CPP when The vs compiler reports this error when there is a function implementation in the H file.

Solution:
1 Yes Add inline
2 before the function declaration in H In project – > Attribute – > Linker – > Command line – > Add/force to additional options

The above is loaded from David_H

I also encountered this error, but the whole project contains too many files to analyze the inclusion relationship, but the problem should be similar.

my solution is:

Project – > Properties – > Linker – > Command line – > Add /force 

to additional options

It solved the error, but there were a lot of warnings.

[Solved] QT error: the packaged exe of Enigma virtual box reports an error cannot load library qt5core.dll

Question:

Put the enigma virtual box packaged exe to another computer for use, and an error will be reported when opening the EXE: cannot load library qt5core DLL
(in fact, the library qt5core.DLL is included when using enigma virtual box)

reason:

This is not the lack of qt5core DLL , nor is there a problem with this library. Because [problem solving] the code cannot be executed because libgcc_s_dw2-1.dll, libwinpthread.dll and libstdc + ± 6.dll cannot be found. Reinstallation may solve this problem. This problem is caused by the lack of libgcc_s_dw2-1.DLL, libwinpthread.DLL, libstdc + + - 6.dll , but the error cannot be reported after packaging load library Qt5Core.DLL, the analysis may be because qt5core DLL depends on the above libraries to run.

 

Solution:

From Qt5 12.0\5.12.0\mingw73_64\bin (different versions and different directories) copy the three dynamic libraries libgcc_s_dw2-1.DLL, libwinpthread.DLL, libstdc + + - 6.DLL , and then use the EXE packaged with enigma virtual box to avoid errors.

comparison of directories before and after modification:

[Solved] QT cmak Compile Error: CMake Error: The source.. does not match the soused

**Cmake error: the source… Does not match the used to generate cache Re-run cmake…

Solution:
Delete the CMakeLists.txt.user file in the project.

problem is solved. Later, it is found that the file is also a cache file, which contains the compilation status information of the project before, such as the debug directory. In cmake, if there is this file, the compiler will use the relevant cache information in this file, so various errors will occur:

delete the file and restart cmake, A new file is regenerated.

How to Solve QT uses MSVC compiler to code error

QT uses MSVC compiler, and the code reports an error

1. Premise

After inspection, it is confirmed that your code is correct, and the error reported by QT creator is a pure false alarm.

2. Error examples

[error] Constants with newlines
[error] xxx is not a member of xxx
[error] Syntax error, missing ;
...

3. Solutions

Add the following configuration in *.Pro file.

win32-msvc*: {
    QMAKE_CFLAGS *= /utf-8
    QMAKE_CXXFLAGS *= /utf-8
}

[Solved] Git Clone Error: The TLS connection was non-properly terminated.

Operating system: Ubuntu 18.04

Test time: November 18, 2021

Problem Description:

Recently, the author encountered the following problems when downloading the repository on GitHub by using the GIT clone command, resulting in cloning failure

$ git clone https://github.com/pjreddie/darknet
Clone to 'darknet'...
fatal: unable to access 'https://github.com/pjreddie/darknet/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

Solution:

Modify the HTTPS of the warehouse connection to git to clone

$ git clone https://github.com/pjreddie/darknet

Vs + QT reports an error “vs cannot open the source file qchartview”

Vs + QT reports an error “vs cannot open the source file qchartview”

Just started to develop QT program with VS, not familiar with VS, #include & lt; QChartView> always reports an error and cannot open the source program. The solution is as follows:


add the two directories shown in the figure to the included directory. If qtcharts are not found, it indicates that qtcharts was not installed when QT was installed, and the qtcharts component needs to be reinstalled.

Ubutnu Qt Unable to start process Error: “make“ -f ‘ /usr/bin/ld: cannot find -lGL collect2: error: ld returned 1 exit sta

Ubutnu Qt Unable to start process “make” -f ‘ /usr/bin/ld: cannot find -lGL collect2: error: ld returned 1 exit status

I. Unable to start the process “make” -f ‘
Make is not installed on the system
sudo apt install make

2./usr/bin/ld: cannot find -lGL collect2: error: ld returned 1 exit status
sudo apt-get install libgl1-mesa-dev

QT error: – LGL not found [How to Solve]

QT error: – LGL not found

This is because QT cannot find the OpenGL dynamic link library (LIBGL.So). OpenGL is installed by default in most Linux distributions, including Ubuntu, CentOS, etc. if the link library cannot be found, the path is generally wrong.

Solution
1. Use root to find the path of “LIBGL.So” file. Use find/usr - name "LIBGL *" to find
2. The search result is that the version number is added to the suffix of the OpenGL link library provided with the Linux distribution, such as LIBGL.So.1.2.0, LIBGL.So.1.3.1, etc., but the OpenGL link library found by QT in the link phase does not have the version number. So we need to create a link for the OpenGL link library in the/usr/lib/directory and remove the version number
3. Just create a soft connection with ln - s