The reason is to merge two project programs written by others. There is no problem with separate testing. After merging, compile and report errors
After searching the data, it is suspected that it is related to the header file windows.H
#include<math.h>
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <windows.h> // Commented out to compile properly
#include <map>
#include <any>
My solution is to #include <windows.h>
comment it out (the header file is not used in the code), and then it can run successfully. I didn’t delve into the specific reasons, mainly by referring to the reference materials at the end of the article.
Read More:
- [Solved] C++ error: undefined reference to `xxx‘
- Template argument deduction/substitution failed: couldn‘t deduce template parameter [How to Solve]
- [Solved] Warning: using directive refers to implicitly-defined namespace ‘std’
- Linux C++ Error: invalid use of incomplete type [How to Solve]
- How to Solve QT and PCIe interactive loading setupapi.H error
- [Solved] VScode Run C++ File Error: fatal error:opencv2\core.hpp:No such file or diretory
- [Solved] C++ reason ncnn model error: Segmentation fault (core dumped)
- [Solved] Opencv error: assertion__acrt_first_block == header
- VSCode Error: collect2.exe:error:1d returned 1 exit status [How to Solve]
- Dev C++ Error: error: ld returned 1 exit status [How to Solve]
- No match for ‘operator =’ both ends of the equal sign do not match
- [Solved] Error c2226: syntax error: unexpected ‘lpstr’ type
- [Solved] PCL Compile Error: undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>:: XXX
- [Solved] OpenCV error: #error “This header with legacy C API declarations has been removed from OpenCV.
- [Solved] Compile Error: cannot open include file ‘afxres.h‘
- [Solved] 1.fatal error: NvInfer.h: No such file or directory
- PCL 1.8.1 VTK 9.0 QT 5.14.9 [How to Solve]
- C++ clang Compile Error: error: expected unqualified-id
- C++ Primer Program in VsCode error: no match for call to ‘(std::__cxx11::string…)