jjzjj

unresolved_overload

全部标签

c++ - 错误 LNK2019 : unresolved external symbol "" referenced in function

我目前在编译代码时遇到以下错误:errorLNK2019:unresolvedexternalsymbol"public:void__thiscallAgent::printSelf(void)"(?printSelf@Agent@@QAEXXZ)referencedinfunction"public:void__thiscallWorld::processMouse(int,int,int,int)"(?processMouse@World@@QAEXHHHH@Z)World.obj这是我的代码代理.h:classAgent{public:Agent();voidprintSelf(

c++ - "no matching function for call to ‘async(std::launch, <unresolved overloaded function type>, std::string&)’“

我正在尝试使用std::async创建线程,但我不断收到错误“没有匹配函数调用‘async(std::launch,,std::string&)’”在行上ConnectFuture=std::async(std::launch::async,Connect_T,ip);这是产生这种行为的代码:#includeclasslibWrapper{public:voidConnect(std::stringip);voidConnect_T(std::stringip);private:std::futureConnectFuture;};voidlibWrapper::Connect(std

c++ - 模板实例化失败 : compiler choosing improper overload function

我对模板并不陌生,但我遇到了一个相当奇怪的问题,我需要将模板类型分离到它的组件中,以用于我正在处理的数据序列化程序。这很难解释,所以我已经证明了。这是我简化的示例问题,example.cpp。templatevoidfoo(T&arg){}templatevoidfoo(T&arg){}intmain(intargc,char*argv[]){foo(argc);return0;}我得到一个错误,然后是一个警告,这似乎表明它正在尝试实例化两个函数,但只有其中一个是合适的。$g++-Wall-Wexample.cppexample.cpp:2:43:error:‘T’isnotatemp

c++ - 错误 LNK2019 : unresolved external symbol

好的,所以我在尝试找出代码中的问题时遇到了问题。我有很多代码,所以我只会发布编译时出现问题的相关部分。我在一个类中有以下函数,它会编译并且一切都会正常运行,直到我调用函数“CalculateProbabilityResults”并在其中运行第7行代码。我已经在我的程序中“取消注释”了这行代码,这样您就可以更容易地找到它。我很确定我有正确的#include指令,因为它在不调用函数时编译得很好,所以这不是问题,不是吗?我知道我的一些命名符号需要一点帮助,所以请多多包涵。在此先感谢您的帮助。intSQLServer::CalculateProbabilityResults(intprofil

c++ - 错误 LNK2019 : unresolved external symbol referenced in function main

我正在尝试用C++运行我的简单汇编代码。我只有两个文件“.cpp”文件和“.asm”文件。编译时出现错误(见下文)。如果有人能提供帮助,我将不胜感激...:)这是我的“main.cpp”文件#includeusingnamespacestd;extern"C"intGetValueFromASM();intmain(intargc,char*argv[]){cout我还有一个简单的“asm.asm”文件.codeGetValueFromASMprocmovrax,3254retGetValueFromASMendpend尝试构建时出现此错误:1>main.obj:errorLNK201

c++ - 为什么不允许使用 "second C linkage of overloaded function"?

我将我的C++dll转换为Cdll:#ifdef__cplusplusextern"C"{#endifMY_EXPORTintmy_func();MY_EXPORTvoidmy_func(intn);#ifdef__cplusplus}#endif没有externC声明一切正常。有了这个声明,我得到了errorC2733:secondClinkageofoverloadedfunction'my_func'notallowed为什么不允许从C风格的dll导出重载函数? 最佳答案 C不允许重载函数。那就是C不支持重载。这是C++的一个

C++ DLL 链接 Unresolved external

我有一个相当大的Core项目,我正在尝试调整它以使用我构建的DLL引擎,我遇到了一堆错误,例如:未解析的外部符号“私有(private):静态类”当在DLL中包含来自核心的一些header时,该类通过__declspec(dllexport)导出,但任何具有静态成员的header都会抛出大量关于静态成员的错误。这是一个相当大的项目,我不能跑来跑去删除我看到的每个静态类成员,有没有这种东西?正在导入的类的基本示例:class__declspec(dllexport)MyClass{public:staticboolm_someVar;}为了清楚起见,我只想说明m_someVar是在类实现

c++ - Unresolved external symbol 链接器错误 (C++)

我正在尝试为我的项目之一开发抽象设计模式代码,如下所示。但是,我无法编译代码......给出了一些编译错误(如“未解析的外部符号”public:virtualvoid__thiscallXsecs::draw_lines(double,double)"(?draw_lines@Xsecs@@UAEXNN@Z)")..任何人都可以帮我解决这个问题......#include"stdafx.h"#include#include#include"Xsecs.h"usingnamespacestd;//ProductclassclassXsecs{public:virtualvoiddraw_

c++ - 'more than one instance of overloaded function "sqrt“匹配参数列表”怎么办?

我的代码在for循环中出错,for(j=3;j:morethanoneinstanceofoverloadedfunction"sqrt"matchestheargumentlist.我该如何解决?#include//determineifnumberisprimeboolisPrime(longn){intj,num=0;{if(num 最佳答案 尝试:for(j=3;j(num));j+=2)发生的事情是包含3个不同的definitionsofsqrt并且编译器不知道您要使用哪个。

c++ - 错误 LNK2020 : unresolved token (06000002) in Visual C++

我在C++/CLI中创建一个新的抽象类时遇到了一个奇怪的错误。有很多与此类似的问题,但没有一个答案对我有帮助。在这个新类(class)中,我收到以下错误:errorLNK2020:unresolvedtoken(06000002)Foo::execute这是h文件:#pragmaonceusingnamespaceSystem::IO::Ports;usingnamespaceSystem;publicrefclassFoo{protected:SerialPort^port;public:Foo(SerialPort^sp);virtualarray^execute();};这是cp