Tag Archives: visual studio

[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] Visual studio 2022 error LNK2019: unable to resolve external symbol for

Visual studio 2022 error reporting template:

1>*. Obj: error LNK2019: unresolved external symbol “… Void _cdecl…” (..), Function “…” (…?..) The symbol is referenced in

Detailed errors are as follows:

Generation started...
1>------ Generation has started: Project: BIOP, Configuration:Debug x64 ------
1>pRein.cpp
1>run_models.obj : error LNK2019: Unresolved external symbol "private: void __cdecl bTama::initiate(int,int,int,int)" (?initiate@bTama@@AEAAXHHHH@Z),Function "public: __cdecl bTama::bTama(void)" (??0bTama@@QEAA@XZ) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: void __cdecl bTama::insert(struct IntervalSub)" (?insert@bTama@@QEAAXUIntervalSub@@@Z),Function "void __cdecl run_btama_backward1(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" (?run_btama_backward1@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: bool __cdecl bTama::deleteSubscription(struct IntervalSub)" (?deleteSubscription@bTama@@QEAA_NUIntervalSub@@@Z),Function "void __cdecl run_btama_backward1(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" (?run_btama_backward1@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: void __cdecl bTama::forward_match_accurate(struct Pub const &,int &,class std::vector<struct IntervalSub,class std::allocator<struct IntervalSub> > const &)" (?forward_match_accurate@bTama@@QEAAXAEBUPub@@AEAHAEBV?$vector@UIntervalSub@@V?$allocator@UIntervalSub@@@std@@@std@@@Z),函数 "void __cdecl run_btama_forward(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" (?run_btama_forward@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: void __cdecl bTama::backward1_match_accurate(struct Pub const &,int &,class std::vector<struct IntervalSub,class std::allocator<struct IntervalSub> > const &)" (?backward1_match_accurate@bTama@@QEAAXAEBUPub@@AEAHAEBV?$vector@UIntervalSub@@V?$allocator@UIntervalSub@@@std@@@std@@@Z),Function "void __cdecl run_btama_backward1(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" (?run_btama_backward1@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: void __cdecl bTama::backward2_match_accurate(struct Pub const &,int &,class std::vector<struct IntervalSub,class std::allocator<struct IntervalSub> > const &)" (?backward2_match_accurate@bTama@@QEAAXAEBUPub@@AEAHAEBV?$vector@UIntervalSub@@V?$allocator@UIntervalSub@@@std@@@std@@@Z),Function "void __cdecl run_btama_backward2(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" (?run_btama_backward2@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: int __cdecl bTama::calMemory(void)" (?calMemory@bTama@@QEAAHXZ),Function "void __cdecl run_btama_backward1(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" (?run_btama_backward1@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>D:\codes\BIOP\x64\Debug\BIOP.exe : fatal error LNK1120: 7 unresolved external commands
1>The operation to generate the project "BIOP.vcxproj" has been completed-failed.
========== Generation: 0 success, 1 failure, 0 latest, 0 skip ==========

reason:
After adding a new file on another computer or another operating system, submitting it to GitHub, and then returning to the current computer to pull the code, the new file is not imported into the VS project

Solution:
Add the newly created file to the current project, “head/source file→ \rightarrow→Add to→ \rightarrow→Existing items”

[Solved] CMake Error: Could not create named generator Visual Studio 16 2019 -A Win64

Preface
CMake Error: Could not create named generator Visual Studio 16 2019 -A Win64
When using vcpkg to compile OsgEarth, the official compilation method is:
cmake -S osgearth -B build -G “Visual Studio 15 2017 Win64” -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWIN32_USE_MP=ON -DCMAKE_INSTALL_PREFIX=[installroot] -DCMAKE_TOOLCHAIN_FILE=[vcpkgroot]\scripts\buildsystems\vcpkg.cmake


Change the commands below:
cmake -S osgearth -B build -G “Visual Studio 15 2017 Win64” -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWIN32_USE_MP=ON -DCMAKE_INSTALL_PREFIX=[installroot] -DCMAKE_TOOLCHAIN_FILE=[vcpkgroot]\scripts\buildsystems\vcpkg.cmake
to:
cmake -S osgearth -B build -G “Visual Studio 16 2019” -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWIN32_USE_MP=ON -DCMAKE_INSTALL_PREFIX=E:\osgEarth\vcpkg\vcpkg\build -DCMAKE_TOOLCHAIN_FILE=E:\osgEarth\vcpkg\vcpkg\scripts\buildsystems\vcpkg.cmake
That is
(1) Remove Win64
(2) Then change installroot to your OsgEarth generation project path, for example, here is: the path to generate OsgEarth.sln project

(3) Set the path of vcpkg.cmake to
Here:

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.

Error occurred during Microsoft Visual Studio execution. Msb8020 reported an error

Project scenario:

Version inconsistency and error report during using Visual Studio


Problem Description: error msb8020

Problems encountered during execution:

Error
error msb8020: the build tools for visual studio 2012 (V120) (platform toolset = ‘Visual Studio 2012 (V120)’) cannot be found. To build using the visual studio 2012 (V120) build tools, please install visual studio 2012 (V120) build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting “Upgrade Solution…”.


Cause analysis:

Use Microsoft Visual Studio Version for inconsistent reasons


Solution:

Find the solution manager, right-click and select Properties

configuration properties – & gt; General – & gt; Platform toolset – & gt; Select the current version of visual studio


Summary

step by step, lyy come on

[Solved] error LNK2005: ___pInvalidArgHandler Already defined in libcmtd.lib(invarg.obj)

Started generation...
1>------ has been started: Project: Bosch_EDC7, Configuration: Debug Win32 ------
1>edc7.lib(Bosch_EDC7.obj) : MSIL .netmodule or module compiled with /GL found; link is being restarted with /LTCG; adding /LTCG to link command line to improve linker performance
1>LINK : warning LNK4075: ignore "/INCREMENTAL" (due to "/LTCG" specification)
1>Bosch_EDC7.obj : warning LNK4075: ignore "/EDITANDCONTINUE" (due to "/OPT:ICF" specification)
1>LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __call_reportfault has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *, unsigned int,unsigned int)" (? _invoke_watson@@YAXPBG00II@Z) is already defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter has been defined in libcmtd.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *, unsigned int,unsigned int)" (? _invalid_parameter@@YAXPBG00II@Z) is already defined in libcmtd.lib(invarg.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "public: static struct CRuntimeClass const CObject::classCObject" (?classCObject@CObject@@ 2UCRuntimeClass@@B) is already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "public: virtual struct CRuntimeClass * __thiscall CObject::GetRuntimeClass(void)const " (? GetRuntimeClass@CObject@@UBEPAUCRuntimeClass@@XZ) already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "public: class CObject * __thiscall CRuntimeClass::CreateObject(void)" (?CreateObject@ CRuntimeClass@@QAEPAVCObject@@XZ) already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "public: int __thiscall CObject::IsSerializable(void)const " (?IsSerializable@CObject@@QBEHXZ) already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "public: int __thiscall CRuntimeClass::IsDerivedFrom(struct CRuntimeClass const *)const " (? IsDerivedFrom@CRuntimeClass@@QBEHPBU1@@Z) already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "public: int __thiscall CObject::IsKindOf(struct CRuntimeClass const *)const " (?IsKindOf@CObject@@@ QBEHPBUCRuntimeClass@@@Z) is already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "class CObject * __cdecl AfxDynamicDownCast(struct CRuntimeClass *,class CObject *)" (? AfxDynamicDownCast@@YAPAVCObject@@PAUCRuntimeClass@@PAV1@@Z) already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(objcore.obj) : error LNK2005: "void __stdcall AfxClassInit(struct CRuntimeClass *)" (?AfxClassInit@@@YGXPAUCRuntimeClass@@@Z) already defined in nafxcwd.lib(objcore.obj)
1>nafxcw.lib(winmain.obj) : error LNK2005: "class CWinApp * __stdcall AfxGetApp(void)" (?AfxGetApp@@YGPAVCWinApp@@XZ) is already defined in nafxcwd.lib(afxinl2 .obj) is defined in
1>LINK : warning LNK4098: Default library "LIBCMT" conflicts with other libraries; please use /NODEFAULTLIB:library
1>LINK : warning LNK4098: The default library "nafxcw.lib" conflicts with other libraries; please use /NODEFAULTLIB:library
1>D:\A-Working\VS10_Projects\Bosch_EDC7\Bosch_EDC7\Debug\Bosch_EDC7.exe : fatal error LNK1169: One or more multi-defined symbols found
1> The operation to generate the project "Bosch_EDC7.vcxproj" has been completed - failed.
========== Generated: 0 successful, 1 failed, 2 latest, 0 skipped ==========

Solution:
The reason is that in Debug mode, some libraries are used in conflict, we just ignore the conflicting libraries.
Project Project Properties —> Linker —> Input —> Ignore specific default libraries —>

nafxcw.lib;libcmt.lib

Vs2019 + QT parses the XML file and reports an error at doc.setcontent (& file)

Vs2019 + QT parses the XML file and reports an error at doc.setcontent

Made a very low-level mistake. Record the process.

A QT project was established long ago. Now to add a function of parsing XML files using the qdom class, there is always an error in the sentence doc.setcontent (& amp; file) , and there is no error message. The relevant C + + codes are as follows:

QString error;
int line, column;
if (doc.setContent(&file, &error, &line, &column)) {
    qDebug() << doc.toString(4);
}
else {
    qDebug() << "Error:" << error << "in line " << line << "column" << column;
}
file.close();

When doc.setcontent (& amp; file, & amp; error, & amp; line, & amp; column) , critical error detected c00000374 is displayed

The first reaction is that the XML file is incorrectly written. For example, there is no space in the space, Chinese punctuation is entered, or the two sides of the tag are inconsistent
after repeatedly confirming that the XML file is correct, the stackoverflow search said that the relative path cannot be used, but the absolute path must be used… Another attempt of the absolute path is useless.

Create a new project and run it with the same code without error. Through careful comparison, it is found that in the new project, I added the XML class library

but not in the original project!

So far, add $(qtdir) \ include \ qtxml in the C/C + + include directory, add qt5xmld.lib [debug mode] and qt5xml. Lib [release mode] in the linker, and the operation is successful!

Finally, I found that if the XML file is written incorrectly, the above program can locate the error location. Direct reporting of fatal error/critical error or unresolved external symbols like this__ declspec(dllimport) public: __ Cdecl , the probability is that the Lib file link is wrong rather than the code problem. You need to check whether the environment is configured correctly.

A simple question has been wordy for a long time… Mainly to warn yourself that you must think more and think more about ways to expose the problem when you encounter a problem that has no solution on the Internet!

Error 1 fatal error LNK1220: ‘/PGD‘ requires ‘/LTCG:[PGINSTRUMENT|PGOPTIMIZE]‘ specification

VS2008 compilation of an MFC project pop-up error, looking for a long time, did not find the problem.

  resolvent,

According to the official article:/PGD (specify database for profile guided optimizations) | Microsoft docs

  It says how to solve this problem,

  Setup steps,

1. Open the project property setting (right click on the solution project and select properties),

2. Select link = & gt; Optimization=> Profile Guided Database

3. Select & lt; inherit from parent or project defaults>, Click apply and confirm. Then compile and solve the problem.

Qt5core.pdb is not loaded [How to Solve]

When releasing the version, windeployqt is used to generate the corresponding library, but it is inadvertently directly in C: \ QT \ qt5.13.2 \ 5.13.2 \ msvc2017_ Generated in 64 \ bin, overwriting qt5core.dll, resulting in debugging failure

it can be solved by replacing the original qt5core.dll.