Mex_function Unicode.lib

1 Ansicht (letzte 30 Tage)
Hareesh Kumar
Hareesh Kumar am 22 Okt. 2018
Bearbeitet: Jan am 6 Dez. 2018
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 Kommentare
Jan
Jan am 22 Okt. 2018
[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
Jan am 22 Okt. 2018
You mention "Unicode.lib", but did not include it in the mex command, as far as I can see.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Hareesh Kumar
Hareesh Kumar am 6 Dez. 2018
hi can you please tell me how can i include an extrenal x64 release static lib in mexing
currently i am using a build .m script like this
close all;
clc;
%addpath('include','lib')
addpath(genpath(pwd))
disp('Generating release code');
mex('-R2018a','-Iinclude','-Llib/-lsampleunicode lib.lib',''Extract_data.cpp'')
disp('Done');
whre i copied all the include files in include folder and external static lib in lib folder
any thing else i would say the lib name?
please help
  1 Kommentar
Jan
Jan am 6 Dez. 2018
Bearbeitet: Jan am 6 Dez. 2018
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.

Melden Sie sich an, um zu kommentieren.

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by