Call a c++ function in a clips rule

2010-11-03
2012-11-23
  • Hi,
    I have not a great experience with clips and I need a help.
    I want to know if it is possible to define a Clips rule that, if it's assertions are verified, calls a c++ function.
    Something like this:
    defrule ( (assertion1)
                    (assertion2)
                     …
                    =>
                  ( c++ function))
    is it correct to use DefineFunction(…)?

    Thanks

     
  • Gary Riley
    Gary Riley
    2010-11-07

    You can't call a member function of a class using DefineFunction. You can call a regular C style function in C++ code using DefineFunction. The easiest way to do this is to compile all code as C++ code so that you don't have to worry about the different link symbols used by C++ programs as compared to C programs.