Mex_function Unicode.lib
1 回表示 (過去 30 日間)
古いコメントを表示
i have a lib which includes uni coded headers, while mexing with lib headers i am getting lot of compiler errors which is basically unable to convert the arguments from one form to other
#include "SamplwUnicodeCPP.h"
using matlab::mex::ArgumentList;
using matlab::engine::convertUTF8StringToUTF16String;
using namespace matlab::data;
class MexFunction : public matlab::mex::Function
{
ArrayFactory factory;
std::shared_ptr<matlab::engine::MATLABEngine> matlabPtr = getEngine();
CSamplwUnicodeCPP *m_libptr;
public:
MexFunction::MexFunction(void)
{
}
void operator()(ArgumentList outputs, ArgumentList inputs)
{
m_libptr->Getstring();
}
};
and i am including corresponding headers and lib in a.m script
close all;
clc;
%addpath('include','lib')
addpath(genpath(pwd))
disp('Generating release code');
mex('-R2018a','-Iincludes','-Llib', 'Extract_data.cpp')
disp('Done');
i am pretty new to MATLAB, please help, where i am going wrong !!!
3 件のコメント
Jan
2018 年 10 月 22 日
[MOVED from section for answers] Hareesh Kumar wrote:
Thank you Jan
Error using mex Creating library Extract_data.lib and object Extract_data.exp Extract_data.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl CSamplwUnicodeCPP::Getstring(void)" (?Getstring@CSamplwUnicodeCPP@@QEAA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@XZ) referenced in function "public: virtual void __cdecl MexFunction::operator()(class matlab::mex::MexIORange<class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class matlab::data::Array> > > >,class matlab::mex::MexIORange<class std::_Vector_iterator<class std::_Vector_val<struct std::_Simple_types<class matlab::data::Array> > > >)" (??RMexFunction@@UEAAXV?$MexIORange@V?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@VArray@data@matlab@@@std@@@std@@@std@@@mex@matlab@@0@Z) Extract_data.mexw64 : fatal error LNK1120: 1 unresolved externals
this is the error i am getting i placed all the lib and includes in same root folder
Jan
2018 年 10 月 22 日
You mention "Unicode.lib", but did not include it in the mex command, as far as I can see.
回答 (1 件)
Hareesh Kumar
2018 年 12 月 6 日
1 件のコメント
Jan
2018 年 12 月 6 日
編集済み: Jan
2018 年 12 月 6 日
This seems to be a new question. Please open a new thread instead of attaching it in the section for answers of another question.
There is no reason to pollute the path with the current folder in addpath(genpath(pwd)). Omit this line. Use absolute folder names instead.
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!