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:
- How to Solve Fatal error stdatomic in C/C++ Compilation
- Grpc Compilation issues: “C++ versions less than C++11 are not supported.
- [Solved] URIError: Failed to decode param ‘/%3C%=%20BASE_URL%20%3Estatic/index.%3C%=%20VUE_APP_INDEX_CSS_HASH%20%3E.css’
- Cmake Setting Support C++11 This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options
- Cannot start container 39f96c64a9c6: [8] System error: exec format error
- bazel Compile Error: absl/base/policy_checks.h:79:2: error: #error “C++ versions less than C++14 are not supported.”
- [Solved] error C2041: illegal digit ‘9‘ for base ‘8‘ | error C2059: syntax error: ‘bad suffix on number‘
- [Solved] error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools“
- [Solved] Error: error C2601: ‘b‘ : local function definitions are illegal error C2063: ‘b‘ : not a function
- [Solved] fatal error C1189: #error: STL1003: Unexpected compiler, expected C++ compiler
- [Solved] Keil C Error: error C141: syntax error near ‘=‘, expected ‘__asm‘
- [Solved] C++ error: undefined reference to `xxx‘
- [Solved] cmake: symbol lookup error: cmake: undefined symbol: _ZN4Json5ValueC1ERKSs
- Linux C++ Error: invalid use of incomplete type [How to Solve]
- [Solved] C++ Compile Error: prerequisites are different [How to Solve]
- [Solved] fatal error C1083: Cannot open included files: “stdafx.h”: No such file or directory
- [Solved] C++ reason ncnn model error: Segmentation fault (core dumped)
- C++ BUG: [Error] invalid array assignment
- [Solved] qt phonon Play wav file Error:“symbol lookup error: /usr/lib/kde4/plugins/phonon_backend/phonon_gstreamer.so: undefined symbol: _ZNK6Phonon11MediaSource3mrlEv”
- [Solved] C++ Compile: error LNK2019: unresolved external “XX“