Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/144.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
c++;保存mat文件,构建日志显示;未定义对'的引用;H5Tget成员类型'&引用; 当我使用CODBROCK编译一个C++程序来将矩阵保存到一个Mat文件时,下面是生成日志。在linux上。我已经设置了构建选项、链接器设置、链接库、libmat.so、libeng.so、libmx.so。在搜索目录中,在选项卡编译器中,我添加“/usr/local/MATLAB/R2011a/extern/include”,在选项卡链接器中,我添加“/usr/local/MATLAB/R2011a/bin/glnx86”。构建日志是什么意思?如何修复它_C++_Linux_Matlab_Codeblocks_Mat - Fatal编程技术网

c++;保存mat文件,构建日志显示;未定义对'的引用;H5Tget成员类型'&引用; 当我使用CODBROCK编译一个C++程序来将矩阵保存到一个Mat文件时,下面是生成日志。在linux上。我已经设置了构建选项、链接器设置、链接库、libmat.so、libeng.so、libmx.so。在搜索目录中,在选项卡编译器中,我添加“/usr/local/MATLAB/R2011a/extern/include”,在选项卡链接器中,我添加“/usr/local/MATLAB/R2011a/bin/glnx86”。构建日志是什么意思?如何修复它

c++;保存mat文件,构建日志显示;未定义对'的引用;H5Tget成员类型'&引用; 当我使用CODBROCK编译一个C++程序来将矩阵保存到一个Mat文件时,下面是生成日志。在linux上。我已经设置了构建选项、链接器设置、链接库、libmat.so、libeng.so、libmx.so。在搜索目录中,在选项卡编译器中,我添加“/usr/local/MATLAB/R2011a/extern/include”,在选项卡链接器中,我添加“/usr/local/MATLAB/R2011a/bin/glnx86”。构建日志是什么意思?如何修复它,c++,linux,matlab,codeblocks,mat,C++,Linux,Matlab,Codeblocks,Mat,源代码: #include <string> #include <iostream> #include "matrix.h" #include "mat.h" using namespace std; void saveMat(mxArray* m, const string fileName){ MATFile* pmatFile = NULL; mxArray* pMxArray = NULL; string whole_name = fileName + ".ma

源代码:

#include <string>
#include <iostream>
#include "matrix.h"
#include "mat.h"
using namespace std;

void saveMat(mxArray* m, const string fileName){
MATFile* pmatFile = NULL;
mxArray* pMxArray = NULL;
string whole_name = fileName + ".mat";
pmatFile = matOpen(whole_name.c_str(),"w");
int row_num = mxGetM(m);
int col_num = mxGetN(m);
pMxArray = mxCreateDoubleMatrix(row_num, col_num, mxREAL);
double *data;
data = mxGetPr(m);
mxSetData(pMxArray, data);
unsigned found = fileName.find_last_of("/\\");
string name = fileName.substr(found+1);
matPutVariable(pmatFile, name.c_str(),pMxArray);
matClose(pmatFile);}
#包括
#包括
#包括“矩阵h”
#包括“材料h”
使用名称空间std;
void saveMat(mxArray*m,常量字符串文件名){
MATFile*pmatFile=NULL;
mxArray*pMxArray=NULL;
字符串全名=文件名+“.mat”;
pmatFile=matOpen(全称为c_str(),“w”);
int row_num=mxGetM(m);
int col_num=mxGetN(m);
pMxArray=mxCreateDoubleMatrix(行数、列数、mxREAL);
双*数据;
数据=mxGetPr(m);
mxSetData(pMxArray,数据);
unsigned find=文件名。查找(“/\ \”)中的最后一个;
字符串名称=fileName.substr(找到+1);
matPutVariable(pmatFile,name.c_str(),pMxArray);
matClose(pmatFile);}
生成日志:

warning: libmwfl.so, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmat.so, not found (try using -rpath or -rpath-link)
warning: libut.so, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmat.so, not found (try using -rpath or -rpath-link)
warning: libmx.so, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmat.so, not found (try using -rpath or -rpath-link)
warning: libhdf5_hl.so.6, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmat.so, not found (try using -rpath or -rpath-link)
warning: libhdf5.so.6, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmat.so, not found (try using -rpath or -rpath-link)
warning: libmwresource_core.so, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmx.so, not found (try using -rpath or -rpath-link)
warning: libmwi18n.so, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmx.so, not found (try using -rpath or -rpath-link)
warning: libmwMATLAB_res.so, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmx.so, not found (try using -rpath or -rpath-link)
warning: libboost_date_time.so.1.40.0, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmx.so, not found (try using -rpath or -rpath-link)
warning: libboost_system.so.1.40.0, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmx.so, not found (try using -rpath or -rpath-link)
warning: libboost_thread.so.1.40.0, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmx.so, not found (try using -rpath or -rpath-link)
warning: libicudata.so.42, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmx.so, not found (try using -rpath or -rpath-link)
warning: libicuuc.so.42, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmx.so, not found (try using -rpath or -rpath-link)
warning: libicui18n.so.42, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmx.so, not found (try using -rpath or -rpath-link)
warning: libicuio.so.42, needed by /usr/local/MATLAB/R2011a/bin/glnx86/libmx.so, not found (try using -rpath or -rpath-link)

/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Tget_member_type'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `ut_array_length'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5P_CLS_FILE_CREATE_g'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5T_NATIVE_SHORT_g'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `resource_core::BaseMsgID::getName() const'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Pset_type_conv_cb'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Pcreate'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Tcopy'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `ut_ghash_query'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Aget_space'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Sget_simple_extent_dims'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `MATLAB::checkDimCommon::nonnegativeSize::nonnegativeSize()'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `utInferInstallRoot()'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `MATLAB::checkDimCommon::complexSize::complexSize()'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Eset_auto2'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `utSingleConvert'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `utf16_strlen_lim'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `utGetFormatEndian'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `utf16_strcpy'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Sget_simple_extent_ndims'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Aget_type'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Fcreate'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `MATLAB::colon::logicalInput::logicalInput()'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Sset_extent_simple'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Pset_layout'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Sclose'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `utFinite'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `utF2cstr'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Rcreate'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `utFlipFourBytes'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5T_NATIVE_SCHAR_g'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Scopy'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `MATLAB::Cell2Struct::InvalidFieldName::InvalidFieldName(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Tlock'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Tget_class'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `typeinfo for MathWorks::System::InternalException'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `fl::mem::aligned_heap::instance'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `utLogWarning(utWarningManagerContext*, char const*, char const*, char*, char const*, bool)'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Gunlink'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Tget_nmembers'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `utFree'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `ucnv_reset_4_2'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `MATLAB::getReshapeDims::notSameNumel::notSameNumel()'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Acreate2'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `MathWorks::I18N::cast(MathWorks::I18N::UnicodeConverterX*)'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `utTmpnam'
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so||undefined reference to `MATLAB::AddField::InvalidFieldName::InvalidFieldName(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Aclose'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5T_NATIVE_ULONG_g'
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so||undefined reference to `H5Pset_deflate'
More errors follow but not being shown.
Edit the max errors limit in compiler options...
=== Build finished: 50 errors, 15 warnings ===
警告:未找到/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so所需的libmwfl.so(请尝试使用-rpath或-rpath链接)
警告:未找到/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so所需的libut.so(请尝试使用-rpath或-rpath链接)
警告:找不到/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so所需的libmx.so(请尝试使用-rpath或-rpath链接)
警告:找不到/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so所需的libhdf5_hl.so.6(请尝试使用-rpath或-rpath链接)
警告:找不到/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so所需的libhdf5.so.6(请尝试使用-rpath或-rpath链接)
警告:未找到/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so所需的libmwsource_core.so(请尝试使用-rpath或-rpath链接)
警告:未找到/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so所需的libmwi18n.so(请尝试使用-rpath或-rpath链接)
警告:未找到/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so所需的libmwmatalab_res.so(请尝试使用-rpath或-rpath链接)
警告:未找到/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so所需的libboost_date_time.so.1.40.0(请尝试使用-rpath或-rpath链接)
警告:未找到/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so所需的libboost_system.so.1.40.0(请尝试使用-rpath或-rpath链接)
警告:找不到/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so所需的libboost_thread.so.1.40.0(请尝试使用-rpath或-rpath链接)
警告:找不到/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so所需的libicudata.so.42(请尝试使用-rpath或-rpath链接)
警告:未找到/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so所需的libicuuc.so.42(请尝试使用-rpath或-rpath链接)
警告:未找到/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so所需的libicui18n.so.42(请尝试使用-rpath或-rpath链接)
警告:未找到/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so所需的libicuio.so.42(请尝试使用-rpath或-rpath链接)
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Tget_成员_类型”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so | |未定义对“ut_数组长度”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5P_CLS_FILE_CREATE_g”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5T_NATIVE_SHORT_g”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so | |未定义对'resource_core::BaseMsgID::getName()const'的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Pset_type_conv_cb”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Pcreate”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Tcopy”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so | |未定义对“ut_ghash_query”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Aget_空间”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Sget_simple_extent_dims”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so | |未定义对“MATLAB::checkDimCommon::nonnegativeSize::nonnegativeSize()的引用”
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so | |未定义对“utInferInstallRoot()”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so | |未定义对“MATLAB::checkDimCommon::complexSize::complexSize()的引用”
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Eset_auto2”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“utSingleConvert”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so | |未定义对“utf16_strlen_lim”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“utGetFormatEndian”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so | |未定义对“utf16_strcpy”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Sget_simple_extent_ndims”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Aget_类型”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Fcreate”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so | |未定义对“MATLAB::colon::logicalInput::logicalInput()”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Sset_extent_simple”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Pset_布局”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Sclose”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmx.so | |未定义对“utFinite”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“utF2cstr”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5Rcreate”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“utFlipFourBytes”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义对“H5T_NATIVE_SCHAR|g”的引用
/usr/local/MATLAB/R2011a/bin/glnx86/libmat.so | |未定义的r