草庐IT

undefined-symbol

全部标签

c++ - 对 __cxa_end_cleanup' 的 undefined reference

我正在尝试构建一个C++项目,但是当它完成时抛出此错误:undefinedreferenceto__cxa_end_cleanup'使用的工具链是ARMGCC4.7.3,链接器自定义标志是:-mthumb-march=armv6-m-T.\Generated_Source\PSoC4\cm0gcc.ld-g-Wl,-Map,${OutputDir}\${ProjectShortName}.map-specs=nano.specs-Wl,--gc-sections上述错误的一般原因是什么?哪些链接器标志可以解决此错误? 最佳答案 无论

c++ - "Undefined reference to"链接目标文件时出错

这个问题在这里已经有了答案:"undefinedreferenceto"errorswhenlinkingstaticClibrarywithC++code(1个回答)关闭6年前。我意识到这个问题已经以多种方式提出,包括thisverycomprehensiveanswer但我看了很多,并尝试修复我的错误,但无济于事。我正在使用.cpp和.c文件来创建程序。我用g++编译了所有文件,它似乎没有更多的链接错误,尽管它给了我一堆与C语法相关的C++错误。这是我使用的命令:g++-oprogrammain.cpp/data/*.c-l[...libs]main.cpp调用.c文件中的函数。然

C++ 错误 LNK2001 : unresolved external symbol function _main

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:Whatisanundefinedreference/unresolvedexternalsymbolerrorandhowdoIfixit?我正在学习C++,但在我的项目中遇到编译问题。我已经阅读了大量标题上有此错误的帖子,但我找不到问题出在哪里。我的Main函数中有一个方法调用是导致错误的原因。每当我评论该项目编译完美的行。代码如下:main.cpp#pragmaonce#include"stdafx.h"#include#include#include#include#include#include"N

检查与“ true”,“ false”和“ undefined”有关的打字稿/JavaScript中的布尔值

我可以确定布尔值检查的唯一结果是“true”或“false”的明确方法?换句话说,我想将“未定义”排除在于可能的可能性。两个选项是:功能一:privatecanMove=(currentOptionSelected):boolean=>{if(this.client.services){for(constserviceofthis.client.services){if(service===currentOptionSelected){if(service.currentStage==='enrolling'){returntrue;}}}}}功能2:privatecanMove=(curre

c++ - 访问静态 constexpr float 成员时 undefined reference

此代码有效:structBlob{staticconstexprinta=10;};intmain(){Blobb;autoc=b.a;}但是如果我将int更改为float我会得到一个错误:structBlob{staticconstexprfloata=10.0f;};/tmp/main-272d80.o:Infunctionmain':main.cpp:(.text+0xe):undefinedreferencetoBlob::a'为什么我不能以这种方式使用constexprfloat?编译器:Ubuntuclang版本3.5.0-4ubuntu2(tags/RELEASE_350

c++ - 对 `forkpty' 的 undefined reference

所以我在Ubuntu10.04的Eclipse中开发我的项目。我有以下代码行:#includepid_tpid;intmaster;pid=forkpty(&master,NULL,NULL,NULL);但是当我尝试在Eclipse中构建它时,出现错误:undefinedreferenceto'forkpty'知道如何解决这个问题吗? 最佳答案 您需要-lutil命令行参数(以使用libutil共享库)。对于eclipse:http://zetcode.com/articles/eclipsecdevelopment/选择项目属性。

c++ - 链接器错误 'unresolved external symbol' : working with templates

我有一个基于模板的类[Allotter.h&Allotter.cpp]:templateclassAllotter{public:Allotter();quint32getAllotment(allotType*);boolremoveAllotment(quint32,intauto_destruct=0);private:QVector>indexReg;intinit_topIndex;};它的用法如[ActiveListener.h&ActiveListener.cpp]所示:classActiveListener:publicQObject{Q_OBJECTpublic:Ac

c++ - 如何在带有大写文件路径的 Eclipse 中使用 ${include_guard_symbol}?

在EclipseCDT中定义代码模板时,我们可以使用一个名为${include_guard_symbol}的变量,它转换为MYFILE_H。我想要更明确的内容:SRC_MYFOLDER_MYFILE_H。我遵循了ananswertoStack OverflowquestionCustomizinginclude-guardforEclipseCDT中给出的步骤,但我得到的只是${include_guard_symbol}返回一个空字符串!我还在StackOverflow上看到了关于addingthenamespacetotheincludeguard的其他相关问题,但这不是我要找的。我

c++ - 链接器错误:对 `std::ctype<char>::_M_widen_init() 的 undefined reference

我在尝试运行示例项目时遇到链接器错误。你能告诉我如何解决这个问题吗?提前致谢。make[1]:Enteringdirectory`/home/rumi/MobiusProject/Multiproc-Paper/Transformer/ssg'/usr/bin/g++-w-DMOBIUS_LITTLE_ENDIAN-DMOBIUS_LINUX-m32-ossgGen_Linux-L../../lib/Linux_lib/-L/home/rumi/Mobius/mobius/Mobius-2.3/Cpp/lib/Linux_lib-L/home/rumi/Mobius/mobius/Mo

c++ - glfw3 编译 undefined reference

我在编译使用glfw3库的程序时遇到问题。尝试使用make进行编译时,我得到了undefinedreference的错误列表,但我的类被编译成.o文件,只有最终的可执行文件没有创建。标准输出:g++-Wall-g-cmain.cpp-lGL-lGLU-lglfw3-lX11-lXxf86vm-lXrandr-lpthread-lXig++-Wall-g-cerror.cpp-lGL-lGLU-lglfw3-lX11-lXxf86vm-lXrandr-lpthread-lXig++-Wall-g-csWindow.cpp-lGL-lGLU-lglfw3-lX11-lXxf86vm-lXr