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 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!