草庐IT

reference_name

全部标签

c++ - 编译错误 : undefined reference to‘__atomic_fetch_add_4’

#includeusingnamespacecv;intmain(){Matimg=imread("cornea.jpg");imshow("src",img);waitKey(0);return0;}然后我编译它:g++main.cpp-omain`pkg-configopencv--cflags--libs`或g++main.cpp-omain-I/usr/local/opencv-3.1.0/include/opencv-I/usr/local/opencv-3.1.0/include-L/usr/local/opencv-3.1.0/lib-lopencv_shape-lope

c++ - 对 __isoc99_sscanf 的 undefined reference

我有一个使用sscanf的静态C库libex.a。库是使用-std=c99编译的我想在使用-std=c++11编译的某些C++代码中使用库函数,但出现以下错误:lib/libex.a(srcfile.o):Infunction`my_function':/srcpath/srcfile.c:215:undefinedreferenceto`__isoc99_sscanf'经过一番探索后,我发现sscanf由于向后兼容性黑客攻击而存在版本问题,因此重定向到__isoc99_sscanf,所以我怀疑这是不知何故问题的根源。但是,我检查了我的glibc版本,它看起来足够新,以至于其他地方建议

c++ - Boost 1_65_1 不使用 OpenSSL 1.1.0g "undefined reference"编译,但使用 "nm"找到

我正在尝试让SSL与boostASIO一起工作。我在Windows上使用MingW6.3。我用MingW构建了OpenSSL1.1、1.0和0.8,当我尝试将它们链接到项目时,我总是会遇到不同的错误(取决于缺少什么)。现在我正在尝试使OpenSSL1.1.0g工作,但即使我使用CMAKE手动提供库的路径,我也会遇到这些错误:如果我使用OpenSSL1.1.0g构建我的项目,这是错误:"C:\ProgramFiles\JetBrains\CLion2017.2.3\bin\cmake\bin\cmake.exe"--buildC:\Users\myuser\Documents\Mages

c++ - 什么是 undefined reference /未解析的外部符号错误,我该如何解决?

什么是undefinedreference/未解析的外部符号错误?常见原因是什么以及如何修复/预防它们? 最佳答案 编译C++程序需要几个步骤,如2.2(creditstoKeithThompsonforthereference)所指定的那样:Theprecedenceamongthesyntaxrulesoftranslationisspecifiedbythefollowingphases[seefootnote].Physicalsourcefilecharactersaremapped,inanimplementation-

c++ - 振奋 spirit : What type names should be used for the built in terminals?

我正在重构一个类型系统(类型模型),它使用spirit进行字符串序列化。我正在使用类型特征的编译时建模构造。templatetype_traits{typedefboost::spirit::qi::int_parserstring_parser;}templatetype_traits{typedefboost::spirit::ascii::stringstring_parser;}在这个例子中,我展示了原始解析器,但我希望也加入规则。int4类型有效,但这是因为(home/qi/numeric/int.hpp+27):namespacetag{templatestructint_

c++ - Microsoft VS C++ 编译器是否存在 Bug Initialize a reference from a temporary object

这个问题在这里已经有了答案:关闭11年前。PossibleDuplicate:Bindingtemporarytoalvaluereference使用VS2008C++编译器编译代码无编译错误。classA{};intmain(){A&a_ref=A();return0;}我相信C++标准,包括C++2003和即将到来的C++0x,都不允许它。而且我还遇到了gcc编译器的编译时错误。所以我想知道的是,这是VS编译器允许从临时对象初始化引用的已知错误。还是VS编译器的功能扩展?如果是,临时对象的生命周期是多少?

python - c++中python "type(<name>, <bases>, <dict>)"的等价物是什么?

好吧,我正在将python3.3嵌入到C++应用程序中。我希望在C++端动态创建一个Python类,就像我在Python中执行以下操作一样:my_type=type("MyType",(object,),dict())我知道我总是可以导入“builtins”模块,但我一般会尽量避免在C++端导入。谢谢! 最佳答案 以下似乎工作得很好:PyObject*type(constchar*name,boost::python::tuplebases,boost::python::dictdict){returnPyType_Type.tp_

c++ - Opencv,对 `cv::imread(??cv::String const&???, int)' 的 undefined reference

这个问题在这里已经有了答案:error:undefinedreferenceto`cv::imread(std::stringconst&,int)'(4个答案)Whatisanundefinedreference/unresolvedexternalsymbolerrorandhowdoIfixit?(38个答案)关闭5年前。我在QT+Opencv中有一个项目,代码可以正常工作,但我必须格式化窗口,现在我试图再次导入该项目,但出现了这个错误。对`cv::imread(cv::Stringconst&,int)'的undefinedreference在这一行中:mat=cv::imre

c++ - 具有复杂值类型 : confusion with value_type and reference 的迭代器

我想创建一个自定义迭代器包装器,例如enumerate:给定一对类型为T的迭代器,它会返回一个类型为std::pair的可迭代对象,其中该对的第一个元素将取值0、1、2,依此类推。我无法确定应该是什么value_type和reference我的迭代器。我想支持两种行为:首先,引用底层序列的值:for(auto&kv:enumerate(my_vec)){kv.second=kv.first;}(类似于std::iota);其次,复制值:std::vectora{10,20,30};autocopy=*enumerate(a).begin();a[0]=15;std::cout我很困惑I

c++ - 编译错误 : `‘error_category’ does not name a type` with g++ 6. 3.0

我尝试编译这个C++/Python库https://bitbucket.org/fluiddyn/fluidfft如果安装了mpi4py,它运行良好。如果没有安装mpi4py,不使用MPI的代码无法编译。编译Cython文件时出现错误。错误很长,开始于:Infileincludedfrom/usr/include/c++/6/bits/ios_base.h:46:0,from/usr/include/c++/6/ios:42,from/usr/include/c++/6/ostream:38,from/usr/include/c++/6/iostream:39,fromsrc_cpp/