The following error occurred in vs2012:
Error c2039: ‘bind2nd’: not a member of ‘STD’
Add in header file
#include <functional>
The following error occurred in vs2012:
Error c2039: ‘bind2nd’: not a member of ‘STD’
Add in header file
#include <functional>
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.
When compiling an open source project DB engine paradigms
,
The project GitHub address reported an error as follows
/usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vlintrin.h:10325:1: error: inlining failed in call to always_inline '__m256i _mm256_mmask_i32gather_epi32(__m256i, __mmask8, __m256i, const int*, int)': target specific option mismatch
_mm256_mmask_i32gather_epi32 (__m256i __v1_old, __mmask8 __mask,
As soon as I see it, I’ll put cmakelists under the root directory of this project.txt
Add -mavx512vl
! it’s awesome!
# Compiler flags for the different targets
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mtune=native -std=c++14 -fPIC -Wall -Wextra -Wno-psabi -fno-omit-frame-pointer -Wno-unknown-pragmas -mavx512vl")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -Wextra -fno-omit-frame-pointer -march=native -fdiagnostics-color -mavx512vl")
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:
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”
2. Solution:
The original program header file is: #include <libusb.h>
Modify to: #include <libusb-1.0/libusb.h>
1. error: default argument given for parameter 3 of ‘void split(const string&, std::vector<std::__cxx11::basic_string<char> >&, char)’ [-fpermissive]
void split(const std::string &s, std::vector<std::string> &sv, const char flag = ‘ ‘)
^
In file included from /home/zhouying/lcl/test/FotaService/src/util.cpp:5:0:
/home/zhouying/lcl/test/FotaService/include/util.h:6:6: note: previous specification in ‘void split(const string&, std::vector<std::__cxx11::basic_string<char> >&, char)’ here
void split(const std::string &s, std::vector<std::string> &sv, const char flag = ‘ ‘);
Cause: The third formal parameter in the header file util.h is set to the default value, and the third formal parameter in the function definition in util.cpp is set to the default value, resulting in preservation, delete the third formal parameter default value in the function definition in util.cpp
Problem description
This error occurs when I use the opencv3.4.16 official so file in Android studio
Sort by Pvalue from smallest to largest
Change the build.gradle file
Change arguments “- dandroid_stl = C + + _shared”
to arguments “- dandroid_stl = gnustl_shared”
Possible causes:
Opencv3.4.16 officially uses the gun compiler, so it is specified as gnustl_shared
Once, when using an industrial camera for timing photo recognition, I encountered a situation: at that time, a sub thread was used for timing photo recognition, but after running, it was found that the error of memory overflow was reported when the sub thread was opened, resulting in the collapse of the program. After exclusion, it was found that the vector variable was used in the sub thread. After using the vector variable, the memory is not cleared, resulting in saving. You should use resize to clear the memory.
Program segment with error:
vector<Mat> channels;
split(imgRect, channels);
Mat img = channels.at(0);
Program segments that can operate normally after modification:
vector<Mat> channels;
split(imgRect, channels);
Mat img = channels.at(0);
channels.resize(0);
It is hereby recorded and shared
New an error is reported as follows:
error: invalid new expression of abstract class type XXX
Reason:
the subclass does not fully implement the pure virtual function of the parent class, that is, some functions in the parent class are not implemented in the subclass. The first line of error will prompt which function is not implemented.
Solution:
delete the pure virtual function not implemented in the parent class or implement it in the child class
Error message:
E20211126 11:55:13.654 140412916315904 tensorrt.cpp:10] …/rtSafe/cuda/caskUtils.cpp (98) – Assertion Error in trtSmToCask: 0 (Unsupported SM.)
Reason: tensorrt version does not match CUDA or cudnn version. For example, the author’s tensorrt version is 7.2.1, while CUDA is the latest 11.5 version. CUDA version is too high to adapt:
Solution: reinstall CUDA or tensorrt
suggestion: reinstall CUDA because different versions of tensorrt have inconsistent codes. For example, tensorrt 7.2.1 and tensorrt 8.2.1 require that noexcept be added when rewriting virtual functions. If the amount of code is small, consider reinstalling tensorrt
attach the matching requirements of tensorrt, CUDA and cudnn versions: tensorrt release note
Running a file with a PCL library reports an error #error PCL requires C + + 14 or above
Solution: find all PCL dependent function packages in the project and change their corresponding cmakelists.txt file
For specific modification methods, see
add_compile_options(-std=c++11)
Add a line of code to this line of code
set(CMAKE_CXX_STANDARD 14)
As shown in the figure