C++ programming problems
-
I am doing a c++ program and i met some problems in order to call the declaration function. what should I do in order to call the implementation function properly? Thank you for you all helping. in the declaration part,..... mxArray * mlfImproved_DA1(mxArray * * targets, mxArray * train_features, mxArray * params) { int nargout = 1; mxArray * features = mclGetUninitializedArray(); mxArray * targets__ = mclGetUninitializedArray(); mlfEnterNewContext(1, 2, targets, train_features, params); if (targets != NULL) { ++nargout; } features = Mimproved_DA1(&targets__, nargout, train_features, params); mlfRestorePreviousContext(1, 2, targets, train_features, params); if (targets != NULL) { mclCopyOutputArg(targets, targets__); } else { mxDestroyArray(targets__); } return mlfReturnValue(features); } in the main program...... mwArray *features; mwAarray **targets; //109 features = mlfImproved_DA1( targets, x, m1 ); //110 …………….. after Compiling... matlabfunction.cpp C:\foo\matlabwizard\matlabfunction.cpp(109) : error C2065: 'mwAarray' : undeclared identifier C:\foo\matlabwizard\matlabfunction.cpp(109) : error C2100: illegal indirection C:\foo\matlabwizard\matlabfunction.cpp(110) : error C2664: 'mlfImproved_DA1' : cannot convert parameter 1 from 'class mwArray' to 'struct mxArray_tag ** ' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called Error executing cl.exe. matlabfunction.obj - 3 error(s), 0 warning(s) Vincent Sim
-
I am doing a c++ program and i met some problems in order to call the declaration function. what should I do in order to call the implementation function properly? Thank you for you all helping. in the declaration part,..... mxArray * mlfImproved_DA1(mxArray * * targets, mxArray * train_features, mxArray * params) { int nargout = 1; mxArray * features = mclGetUninitializedArray(); mxArray * targets__ = mclGetUninitializedArray(); mlfEnterNewContext(1, 2, targets, train_features, params); if (targets != NULL) { ++nargout; } features = Mimproved_DA1(&targets__, nargout, train_features, params); mlfRestorePreviousContext(1, 2, targets, train_features, params); if (targets != NULL) { mclCopyOutputArg(targets, targets__); } else { mxDestroyArray(targets__); } return mlfReturnValue(features); } in the main program...... mwArray *features; mwAarray **targets; //109 features = mlfImproved_DA1( targets, x, m1 ); //110 …………….. after Compiling... matlabfunction.cpp C:\foo\matlabwizard\matlabfunction.cpp(109) : error C2065: 'mwAarray' : undeclared identifier C:\foo\matlabwizard\matlabfunction.cpp(109) : error C2100: illegal indirection C:\foo\matlabwizard\matlabfunction.cpp(110) : error C2664: 'mlfImproved_DA1' : cannot convert parameter 1 from 'class mwArray' to 'struct mxArray_tag ** ' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called Error executing cl.exe. matlabfunction.obj - 3 error(s), 0 warning(s) Vincent Sim
-
mwArray is the variable declaration used for MATLAB C++ LIBRARY. merry xmas , kuphryn vincent sim
-
I am doing a c++ program and i met some problems in order to call the declaration function. what should I do in order to call the implementation function properly? Thank you for you all helping. in the declaration part,..... mxArray * mlfImproved_DA1(mxArray * * targets, mxArray * train_features, mxArray * params) { int nargout = 1; mxArray * features = mclGetUninitializedArray(); mxArray * targets__ = mclGetUninitializedArray(); mlfEnterNewContext(1, 2, targets, train_features, params); if (targets != NULL) { ++nargout; } features = Mimproved_DA1(&targets__, nargout, train_features, params); mlfRestorePreviousContext(1, 2, targets, train_features, params); if (targets != NULL) { mclCopyOutputArg(targets, targets__); } else { mxDestroyArray(targets__); } return mlfReturnValue(features); } in the main program...... mwArray *features; mwAarray **targets; //109 features = mlfImproved_DA1( targets, x, m1 ); //110 …………….. after Compiling... matlabfunction.cpp C:\foo\matlabwizard\matlabfunction.cpp(109) : error C2065: 'mwAarray' : undeclared identifier C:\foo\matlabwizard\matlabfunction.cpp(109) : error C2100: illegal indirection C:\foo\matlabwizard\matlabfunction.cpp(110) : error C2664: 'mlfImproved_DA1' : cannot convert parameter 1 from 'class mwArray' to 'struct mxArray_tag ** ' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called Error executing cl.exe. matlabfunction.obj - 3 error(s), 0 warning(s) Vincent Sim
Is the problem that mwAarray could possibly be misspelled? Should it be mwArray? That is probably your problem I think although I am not sure if mwArray is a compatible type with mxArray_tag. All of your problems seem to be stemming from a misspelled var type though. ~LizardWiz()
-
I am doing a c++ program and i met some problems in order to call the declaration function. what should I do in order to call the implementation function properly? Thank you for you all helping. in the declaration part,..... mxArray * mlfImproved_DA1(mxArray * * targets, mxArray * train_features, mxArray * params) { int nargout = 1; mxArray * features = mclGetUninitializedArray(); mxArray * targets__ = mclGetUninitializedArray(); mlfEnterNewContext(1, 2, targets, train_features, params); if (targets != NULL) { ++nargout; } features = Mimproved_DA1(&targets__, nargout, train_features, params); mlfRestorePreviousContext(1, 2, targets, train_features, params); if (targets != NULL) { mclCopyOutputArg(targets, targets__); } else { mxDestroyArray(targets__); } return mlfReturnValue(features); } in the main program...... mwArray *features; mwAarray **targets; //109 features = mlfImproved_DA1( targets, x, m1 ); //110 …………….. after Compiling... matlabfunction.cpp C:\foo\matlabwizard\matlabfunction.cpp(109) : error C2065: 'mwAarray' : undeclared identifier C:\foo\matlabwizard\matlabfunction.cpp(109) : error C2100: illegal indirection C:\foo\matlabwizard\matlabfunction.cpp(110) : error C2664: 'mlfImproved_DA1' : cannot convert parameter 1 from 'class mwArray' to 'struct mxArray_tag ** ' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called Error executing cl.exe. matlabfunction.obj - 3 error(s), 0 warning(s) Vincent Sim
2 problems are obvious: mwAarray is not declared. looks misspelled to me also, the function you are using needs a variable of type mxArray** instead of mwArray** which you are sending. It also returns mxArray* instead of mwArray* which you are trying to stuff the return into.
-
:);) Don't you know about mwarray, let me give you a big good referece. see the book written by Deitel . I really want to discuss visual C++.