草庐IT

undefined-index

全部标签

c++ - Matlab Engine 命令窗口中的 "??? Undefined function or method"

我正在使用VisualStudio编写C++代码,并将一些变量发送到MATLAB引擎。到目前为止没有问题。假设我打开了MATLAB命令窗口并且这些变量:»whosNameSizeBytesClassAttributesQWe1x3652920doubleQWp1x3642912doubleQWu1x3642912double我可以使用标准的MATLAB函数,但我下载了一个新的function.m(设置路径后它在MATLAB中正常工作),MATLAB引擎的命令窗口无法识别或找到它。»isnormq(Q)???Undefinedfunctionormethod'isnormq'我以为它们(

c++ - 错误 : Undefined symbols for architecture x86_64 with classes

我是一名初学者,正在编写一个帮助我节食的有趣程序。该程序尚未完成,但在我编写时正在编译。我不断收到标题中提到的错误:Undefinedsymbolsforarchitecturex86_64withclasses我看过类似的问题,但它们都与模板和继承类有关,这与我的情况不同。我只是在宣布一个类(class),没什么特别的。我认为这与未正确定义类有关,但我无法弄清楚它是什么。这可能是我想念的愚蠢的东西,但我仍然被困住了。谢谢。#include#includeusingnamespacestd;classMeal{private:stringname;intprotein;intcarbs

C++11,枚举类,g++ 的 undefined reference ,与 clang++ 一起工作

我使用了新的C++11“枚举类”类型,并在使用g++时观察到“undefinedreference”问题。这个问题不会发生在clang++中。我不知道是我做错了什么还是g++错误。重现问题的代码是:(4个文件:enum.hpp、enum.cpp、main.cpp和Makefile)//file:enum.hppenumclassMyEnum{val_1,val_2};templatestructFoo{staticconstMyEnumvalue=MyEnum::val_1;};templatestructFoo{staticconstMyEnumvalue=MyEnum::val_2

c++ - 英特尔编译器 - 错误 : identifier "alignof" is undefined

我正在尝试运行alignof运算符的示例。#includestructEmpty{};structFoo{intf2;floatf1;charc;};intmain(){std::cout当我用gcc(g++-std=c++11alignof.cpp)编译它时,我没有得到任何错误。但是当我用icc(icpc-std=c++11alignof.cpp)编译它时,我得到以下错误,我不知道为什么:cenas.cpp(13):error:typenameisnotallowedstd::cout我在同一台机器上运行代码,并使用module命令更改编译器。alignof运算符怎么可能未定义?

c++ - 升级到 OS X Mavericks 后架构 x86_64 的 OpenCV undefined symbol

我有一个运行良好的opencv项目。今天我已经将我的OSXlion升级到Maverick,我收到以下imwrite函数的错误:Undefinedsymbolsforarchitecturex86_64:"cv::imwrite(std::__1::basic_string,std::__1::allocator>const&,cv::_InputArrayconst&,std::__1::vector>const&)",referencedfrom:_maininHello.old:symbol(s)notfoundforarchitecturex86_64我不得不说其他opencv函

c++ - 为什么 sizeof...(T) 这么慢?在没有 sizeof...(T) 的情况下实现 C++14 make_index_sequence

我找到了C++14make_index_sequence“算法”的实现:templatestructindex_sequence{usingtype=index_sequence;};templateusinginvoke=typenameT::type;templatestructconcate;templatestructconcate,index_sequence>:index_sequence{};//\///----------//Ithinkhereisslowly.templatestructmake_index_sequence_help:concate>,invoke

c++ - 将 C++11 lambda 与 boost::multi_index 结合使用

尝试使用C++11lambda作为boost::multi_index的关键访问器:#include#include#includestructFoobar{intkey;};voidfunc(){namespacemii=boost::multi_index;typedefboost::multi_index_container>>Container;}但是从g++4.8.2和boost1.53得到编译错误:error:couldnotconverttemplateargument'func()::__lambda0{}'to'int(*)(constFoobar&)'这个答案Usi

c++ - 对 'cv::viz::Viz3d::Viz3d(std::string&const)' 的 undefined reference

我已经使用qtcreator运行了我的opencv代码,当我尝试使用Viz库时得到了这个答案。代码:#include#include#include#include#include///Createawindowviz::Viz3dmyWindow("VizDemo");///StarteventloopmyWindow.spin();///Eventloopisoverwhenpressedq,Q,e,Eprintf("Firsteventloopisover\n");///Accesswindowviaitsnameviz::Viz3dsameWindow=viz::getWind

c++ - GCC 向依赖默认构造函数的模板化类中的静态数据成员给出 "undefined reference"错误

我遇到了类似的问题:"undefinedreference"tostaticfieldtemplatespecialization但他们使用的解决方法对我不起作用。我有一个带有静态数据成员的CRTP类,其中之一是std::mutex。不幸的是,GCC(4.8.2)的链接器给我这个互斥锁的“undefinedreference”错误。Clang(3.4)没有。有解决方法吗?最初的问题(上面链接)在静态数据成员上调用了复制构造函数,迫使GCC发出一个符号,但是由于我的数据成员是std::mutex,所以这不是一个选项——复制构造函数被删除,并且有没有参数构造函数。我只是被冲洗了吗?我认为问

c++ - 使用 CMake 对 `shm_open' 的 undefined reference

我在Ubuntu14.04下使用CMake配置我的项目。我需要使用第3方库(比如stuff.so)。在CMakeLists.txt中,我使用TARGET_LINK_LIBRARIES链接素材库。但是,我得到一个错误:DIR_TO_LIB/stuff.so:-1:error:undefinedreferenceto`shm_open'我试图将这些标志放在CMakeLists.txt中,但没有成功:set(CMAKE_EXE_LINKER_FLAGS"${CMAKE_EXE_LINKER_FLAGS}-lrt")set(CMAKE_CXX_FLAGS"${CMAKE_CXX_FLAGS}-