Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C++ programming problems

C++ programming problems

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vincent Sim
    wrote on last edited by
    #1

    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

    V L N 3 Replies Last reply
    0
    • V 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

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      What is mwAarray? Kuphryn

      V U 2 Replies Last reply
      0
      • V valikac

        What is mwAarray? Kuphryn

        V Offline
        V Offline
        Vincent Sim
        wrote on last edited by
        #3

        mwArray is the variable declaration used for MATLAB C++ LIBRARY. merry xmas , kuphryn vincent sim

        1 Reply Last reply
        0
        • V 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

          L Offline
          L Offline
          LizardWiz
          wrote on last edited by
          #4

          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()

          1 Reply Last reply
          0
          • V 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

            N Offline
            N Offline
            nema32
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • V valikac

              What is mwAarray? Kuphryn

              U Offline
              U Offline
              User 785164
              wrote on last edited by
              #6

              :);) 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++.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups