草庐IT

unresolved-external

全部标签

c++ - 什么是 undefined reference / Unresolved external symbol 错误,我该如何解决?

什么是undefinedreference/Unresolvedexternalsymbol错误?什么是常见原因以及如何解决/预防它们? 最佳答案 按照2.2(creditstoKeithThompsonforthereference)的规定,编译C++程序需要几个步骤。:Theprecedenceamongthesyntaxrulesoftranslationisspecifiedbythefollowingphases[seefootnote].Physicalsourcefilecharactersaremapped,inan

c++ - C++中extern "C"的作用是什么?

将extern"C"放入C++代码到底有什么作用?例如:extern"C"{voidfoo();} 最佳答案 extern"C"使C++中的函数名具有C链接(编译器不会破坏名称),以便客户端C代码可以使用C兼容header链接到(使用)您的函数仅包含函数声明的文件。您的函数定义包含在二进制格式(由您的C++编译器编译)中,然后客户端C链接器将使用C名称链接到该格式。由于C++有函数名重载,而C没有,C++编译器不能只使用函数名作为链接的唯一id,因此它通过添加有关参数的信息来破坏名称。C编译器不需要修改名称,因为您不能在C中重载函数

c++ - 为什么模板不能在 extern "C" block 内?

这是ananswer的后续问题。至Isitpossibletotypedefapointer-to-extern-“C”-functiontypewithinatemplate?此代码无法使用g++、VisualC/C++和ComeauC/C++编译,错误消息基本相同:#includeextern"C"{staticintdo_stuff(int){return3;}templatestructtest{staticvoidfoo(return_t_(*)(arg1_t_)){}};}intmain(){test::foo(&do_stuff);returnEXIT_SUCCESS;}

c++ - 为什么模板不能在 extern "C" block 内?

这是ananswer的后续问题。至Isitpossibletotypedefapointer-to-extern-“C”-functiontypewithinatemplate?此代码无法使用g++、VisualC/C++和ComeauC/C++编译,错误消息基本相同:#includeextern"C"{staticintdo_stuff(int){return3;}templatestructtest{staticvoidfoo(return_t_(*)(arg1_t_)){}};}intmain(){test::foo(&do_stuff);returnEXIT_SUCCESS;}

c++ - 什么时候用简单的话用extern "C"?

这个问题在这里已经有了答案:Whatistheeffectofextern"C"inC++?(16个答案)关闭8年前.也许我不了解C和C++之间的区别,但我们何时以及为什么需要使用extern"C"{?显然它是一个“链接约定”。我简要地阅读了它,并注意到MSVS中包含的所有.h头文件都用它包围了它们的代码。究竟什么类型的代码是“C代码”而不是“C++代码”?我以为C++包含所有C代码?我猜测情况并非如此,C++是不同的,标准特性/功能存在于其中一个或另一个但不是两者都存在(即:printf是C,cout是C++),但C++是倒退的通过外部“C”声明兼容。这是正确的吗?我的下一个问题取决

c++ - 什么时候用简单的话用extern "C"?

这个问题在这里已经有了答案:Whatistheeffectofextern"C"inC++?(16个答案)关闭8年前.也许我不了解C和C++之间的区别,但我们何时以及为什么需要使用extern"C"{?显然它是一个“链接约定”。我简要地阅读了它,并注意到MSVS中包含的所有.h头文件都用它包围了它们的代码。究竟什么类型的代码是“C代码”而不是“C++代码”?我以为C++包含所有C代码?我猜测情况并非如此,C++是不同的,标准特性/功能存在于其中一个或另一个但不是两者都存在(即:printf是C,cout是C++),但C++是倒退的通过外部“C”声明兼容。这是正确的吗?我的下一个问题取决

c++ - 未解析的外部符号 - Qt 创建者

我一定是遗漏了一个带有标题和包含的基本概念,因为当我尝试从单独的源文件中调用最简单的函数时,我得到一个错误:main.obj:-1:error:LNK2019:unresolvedexternalsymbol"void__cdeclbuildDeck(int,int)"(?buildDeck@@YAXHH@Z)referencedinfunction_main甲板.h#ifndefDECK_H#defineDECK_H#includevoidbuildDeck(intdeckSize,intjokers);structcard{QStringsuit;QStringcolor;intr

c++ - 未解析的外部符号 - Qt 创建者

我一定是遗漏了一个带有标题和包含的基本概念,因为当我尝试从单独的源文件中调用最简单的函数时,我得到一个错误:main.obj:-1:error:LNK2019:unresolvedexternalsymbol"void__cdeclbuildDeck(int,int)"(?buildDeck@@YAXHH@Z)referencedinfunction_main甲板.h#ifndefDECK_H#defineDECK_H#includevoidbuildDeck(intdeckSize,intjokers);structcard{QStringsuit;QStringcolor;intr

ruby-on-rails - 带有 WARN 的 jekyll -v:Gem::Specification.reset 期间 Unresolved 规范:

我想使用HPSTRjekyll主题,当我执行jekyllserve时,终端向我抛出错误:/Library/Ruby/Gems/2.0.0/gems/bundler-1.10.3/lib/bundler/spec_set.rb:92:in`blockinmaterialize':Couldnotfindcoffee-script-source-1.9.1inanyofthesources(Bundler::GemNotFound)from/Library/Ruby/Gems/2.0.0/gems/bundler-1.10.3/lib/bundler/spec_set.rb:85:in`m

css - gulp-ruby-sass : 'bundle' is not recognized as an internal or external command, 可运行程序或批处理文件

我正在尝试在Windows上运行gulp-ruby-sass。我收到以下错误:gulp-ruby-sass:'bundle'isnotrecognizedasaninternalorexternalcommand,operableprogramorbatchfile.我已经在我的c:\驱动器(c:\Ruby193)上成功安装了ruby​​我还安装了SaSSgeminstallsass(从这里执行c:\Ruby193)windows我也设置了注册路径c:\ruby193我正在从c:\project\transformer\作为gulp运行我的gulp我仍然收到此错误:gulp-ruby-