草庐IT

unresolved_overload

全部标签

c++ - 常量不匹配 : 2 overloads have no legal conversion for 'this' pointer

我收到了这个奇怪的错误:errorC2663:'sf::Drawable::SetPosition':2overloadshavenolegalconversionfor'this'pointer我认为这与const不匹配有关,但我不知道在哪里,或者为什么。在下面的代码中,我有一个形状和Sprite的vector,当尝试访问其中一个vector形状并调用它的一个函数时,我遇到了错误。std::vectorShapes;std::vectorSprites;boolAddShape(sf::Shape&S){Shapes.push_back(S);returntrue;};boolAdd

c++ - 常量不匹配 : 2 overloads have no legal conversion for 'this' pointer

我收到了这个奇怪的错误:errorC2663:'sf::Drawable::SetPosition':2overloadshavenolegalconversionfor'this'pointer我认为这与const不匹配有关,但我不知道在哪里,或者为什么。在下面的代码中,我有一个形状和Sprite的vector,当尝试访问其中一个vector形状并调用它的一个函数时,我遇到了错误。std::vectorShapes;std::vectorSprites;boolAddShape(sf::Shape&S){Shapes.push_back(S);returntrue;};boolAdd

C++ 编译器错误 : ambiguous call to overloaded function

stringaux;intmaxy,auxx=0;cin>>aux;maxy=(int)sqrt(aux.size());我得到:1>errorC2668:'sqrt':ambiguouscalltooverloadedfunction1>couldbe'longdoublesqrt(longdouble)'1>or'floatsqrt(float)'1>or'doublesqrt(double)'为什么? 最佳答案 string::size()返回size_t,而sqrt在其任何版本中都不接受它。所以编译器必须强制转换,并且不能选

C++ 编译器错误 : ambiguous call to overloaded function

stringaux;intmaxy,auxx=0;cin>>aux;maxy=(int)sqrt(aux.size());我得到:1>errorC2668:'sqrt':ambiguouscalltooverloadedfunction1>couldbe'longdoublesqrt(longdouble)'1>or'floatsqrt(float)'1>or'doublesqrt(double)'为什么? 最佳答案 string::size()返回size_t,而sqrt在其任何版本中都不接受它。所以编译器必须强制转换,并且不能选

C++ vector 问题 - 'LNK2001: unresolved external symbol private: static...'

在有人指责我不查看预先存在的问题之前,我已经查看并意识到它与声明有关,但我仍然无法让它工作(可能与我使用vector有关)。Manager.h:#include"Flight.h"#ifndefmanager_h#definemanager_hclassManager{staticvectorairports;staticvectorflights;public:staticvoidloadAirports();staticvoidloadFlights();staticAirportgetAirport(stringcode);staticvectorsplit(conststrin

C++ vector 问题 - 'LNK2001: unresolved external symbol private: static...'

在有人指责我不查看预先存在的问题之前,我已经查看并意识到它与声明有关,但我仍然无法让它工作(可能与我使用vector有关)。Manager.h:#include"Flight.h"#ifndefmanager_h#definemanager_hclassManager{staticvectorairports;staticvectorflights;public:staticvoidloadAirports();staticvoidloadFlights();staticAirportgetAirport(stringcode);staticvectorsplit(conststrin

c++ - 错误 LNK2019 : unresolved external symbol _main referenced in function ___tmainCRTStartup, 但这次不是 Windows/控制台问题!

所以,臭名昭著的错误又回来了。该项目提示它找不到main()方法(这就是错误的意思,对)。但是我确实有一个主项目,而且我的项目应该是一个控制台项目。它以前有效,所以我知道不是那样。此外,该项目有太多的类和文件,我无法将它们全部发布,所以我会根据您的要求发布您需要的任何类。这是VisualStudio2010上的C++、OpenGL和SDL游戏。这不是任何库的问题,因为它在突然莫名其妙地显示此链接器错误之前运行良好。编辑:main()方法:intmain(intargc,char**argv){glutInit(&argc,argv);glutInitDisplayMode(GLUT_D

c++ - 错误 LNK2019 : unresolved external symbol _main referenced in function ___tmainCRTStartup, 但这次不是 Windows/控制台问题!

所以,臭名昭著的错误又回来了。该项目提示它找不到main()方法(这就是错误的意思,对)。但是我确实有一个主项目,而且我的项目应该是一个控制台项目。它以前有效,所以我知道不是那样。此外,该项目有太多的类和文件,我无法将它们全部发布,所以我会根据您的要求发布您需要的任何类。这是VisualStudio2010上的C++、OpenGL和SDL游戏。这不是任何库的问题,因为它在突然莫名其妙地显示此链接器错误之前运行良好。编辑:main()方法:intmain(intargc,char**argv){glutInit(&argc,argv);glutInitDisplayMode(GLUT_D

c++ - 使用 vector 和查找时 C++ 中 Unresolved external 问题

我已经在一个完全独立的项目中尝试了这段代码,它运行良好(唯一的区别是无法运行的项目被导出为DLL)。代码如下:RTATMTHLIB.CPP#include"stdafx.h"#include"RTATMATHLIB.h"#include#include#include#includeusingnamespacestd;doublesomeFunc(double**Y,intlength){vectormyVector;for(inti=0;i::iteratorit=find(myVector.begin(),myVector.end(),value);if(it!=myVector.

c++ - 使用 vector 和查找时 C++ 中 Unresolved external 问题

我已经在一个完全独立的项目中尝试了这段代码,它运行良好(唯一的区别是无法运行的项目被导出为DLL)。代码如下:RTATMTHLIB.CPP#include"stdafx.h"#include"RTATMATHLIB.h"#include#include#include#includeusingnamespacestd;doublesomeFunc(double**Y,intlength){vectormyVector;for(inti=0;i::iteratorit=find(myVector.begin(),myVector.end(),value);if(it!=myVector.