Menu

CLIPS Embedding Problems

Help
eey wrj
2008-06-21
2012-11-23
  • eey wrj

    eey wrj - 2008-06-21

    Hello,
    “Advanced Programming Guide” contains the method to embed CLIPS to VC++. I followed the steps mentioned in section4, actually in 4.17.1.I typed the code into VC++2008. But when I building the project, the system told me “error C3728: 'event System::EventHandler ^System::Windows::Forms::Form::Load': event does not have a raise method” the error is for the sentence “ Load("constructs.clp");” How this happened?
    And I wonder what dose the “Compile all CLIPS files, except main.c, along with all user files.” Means? I just copy the files in “SOURSE” to the project directory without the file main.c and include “clips.h” in the file stdafx.h then build the project. Is there any step I lost?
    Looking for your response. Thank you!

     
    • eey wrj

      eey wrj - 2008-06-21

      Sorry, the first question has been solved by adding “::” before the Load function. The compile now can be passed, but when it comes to the linking the problems appears again as followed:

        test.obj : error LNK2028: unresolved token (0A00000E) "extern "C" void * __clrcall EnvAddDouble(void *,double)" (?EnvAddDouble@@$$J0YMPAXPAXN@Z) referenced in function "private: void __clrcall test::Form1::TripleNumber(struct dataObject *)" (?TripleNumber@Form1@test@@$$FA$AAMXPAUdataObject@@@Z)
        test.obj : error LNK2028: unresolved token (0A00000F) "extern "C" int __clrcall EnvArgTypeCheck(void *,char *,int,int,struct dataObject *)" (?EnvArgTypeCheck@@$$J0YMHPAXPADHHPAUdataObject@@@Z) referenced in function "private: void __clrcall test::Form1::TripleNumber(struct dataObject *)" (?TripleNumber@Form1@test@@$$FA$AAMXPAUdataObject@@@Z)
        test.obj : error LNK2028: unresolved token (0A000010) "extern "C" void * __clrcall EnvAddLong(void *,__int64)" (?EnvAddLong@@$$J0YMPAXPAX_J@Z) referenced in function "private: void __clrcall test::Form1::TripleNumber(struct dataObject *)" (?TripleNumber@Form1@test@@$$FA$AAMXPAUdataObject@@@Z)
        test.obj : error LNK2028: unresolved token (0A000011) "extern "C" void * __clrcall GetCurrentEnvironment(void)" (?GetCurrentEnvironment@@$$J0YMPAXXZ) referenced in function "private: void __clrcall test::Form1::TripleNumber(struct dataObject *)" (?TripleNumber@Form1@test@@$$FA$AAMXPAUdataObject@@@Z)
        test.obj : error LNK2028: unresolved token (0A000012) "extern "C" int __clrcall EnvArgCountCheck(void *,char *,int,int)" (?EnvArgCountCheck@@$$J0YMHPAXPADHH@Z) referenced in function "private: void __clrcall test::Form1::TripleNumber(struct dataObject *)" (?TripleNumber@Form1@test@@$$FA$AAMXPAUdataObject@@@Z)
        test.obj : error LNK2028: unresolved token (0A000013) "extern "C" __int64 __clrcall Run(__int64)" (?Run@@$$J0YM_J_J@Z) referenced in function "private: void __clrcall test::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@test@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
        test.obj : error LNK2028: unresolved token (0A000014) "extern "C" void __clrcall Reset(void)" (?Reset@@$$J0YMXXZ) referenced in function "private: void __clrcall test::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@test@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
        test.obj : error LNK2028: unresolved token (0A000015) "extern "C" int __clrcall Load(char *)" (?Load@@$$J0YMHPAD@Z) referenced in function "private: void __clrcall test::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@test@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
        test.obj : error LNK2028: unresolved token (0A00002B) "extern "C" void __clrcall InitializeEnvironment(void)" (?InitializeEnvironment@@$$J0YMXXZ) referenced in function "public: __clrcall test::Form1::Form1(void)" (??0Form1@test@@$$FQ$AAM@XZ)
        test.obj : error LNK2019: unresolved external symbol "extern "C" __int64 __clrcall Run(__int64)" (?Run@@$$J0YM_J_J@Z) referenced in function "private: void __clrcall test::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@test@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
        test.obj : error LNK2019: unresolved external symbol "extern "C" void __clrcall Reset(void)" (?Reset@@$$J0YMXXZ) referenced in function "private: void __clrcall test::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@test@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
        test.obj : error LNK2019: unresolved external symbol "extern "C" int __clrcall Load(char *)" (?Load@@$$J0YMHPAD@Z) referenced in function "private: void __clrcall test::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@test@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
        test.obj : error LNK2019: unresolved external symbol "extern "C" void * __clrcall EnvAddDouble(void *,double)" (?EnvAddDouble@@$$J0YMPAXPAXN@Z) referenced in function "private: void __clrcall test::Form1::TripleNumber(struct dataObject *)" (?TripleNumber@Form1@test@@$$FA$AAMXPAUdataObject@@@Z)
        test.obj : error LNK2019: unresolved external symbol "extern "C" int __clrcall EnvArgTypeCheck(void *,char *,int,int,struct dataObject *)" (?EnvArgTypeCheck@@$$J0YMHPAXPADHHPAUdataObject@@@Z) referenced in function "private: void __clrcall test::Form1::TripleNumber(struct dataObject *)" (?TripleNumber@Form1@test@@$$FA$AAMXPAUdataObject@@@Z)
        test.obj : error LNK2019: unresolved external symbol "extern "C" void * __clrcall EnvAddLong(void *,__int64)" (?EnvAddLong@@$$J0YMPAXPAX_J@Z) referenced in function "private: void __clrcall test::Form1::TripleNumber(struct dataObject *)" (?TripleNumber@Form1@test@@$$FA$AAMXPAUdataObject@@@Z)
        test.obj : error LNK2019: unresolved external symbol "extern "C" int __clrcall EnvArgCountCheck(void *,char *,int,int)" (?EnvArgCountCheck@@$$J0YMHPAXPADHH@Z) referenced in function "private: void __clrcall test::Form1::TripleNumber(struct dataObject *)" (?TripleNumber@Form1@test@@$$FA$AAMXPAUdataObject@@@Z)
        test.obj : error LNK2019: unresolved external symbol "extern "C" void * __clrcall GetCurrentEnvironment(void)" (?GetCurrentEnvironment@@$$J0YMPAXXZ) referenced in function "private: void __clrcall test::Form1::TripleNumber(struct dataObject *)" (?TripleNumber@Form1@test@@$$FA$AAMXPAUdataObject@@@Z)
        test.obj : error LNK2019: unresolved external symbol "extern "C" void __clrcall InitializeEnvironment(void)" (?InitializeEnvironment@@$$J0YMXXZ) referenced in function "public: __clrcall test::Form1::Form1(void)" (??0Form1@test@@$$FQ$AAM@XZ)
        D:\My Documents\Visual Studio 2008\Projects\test\Debug\test.exe : fatal error LNK1120: 18 unresolved externals
      Build log was saved at "file://d:\My Documents\Visual Studio 2008\Projects\test\test\Debug\BuildLog.htm"
      test - 19 error(s), 0 warning(s)
      ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

        I would be really appreciated if could help me solve this question. Thank you!

       
    • Gary Riley

      Gary Riley - 2008-06-25

      It looks like you created a forms project which you don't want to do because of the Microsoft managed/unmanaged code chasm. Use the Visual C++ 2008 project that comes with the release 3 6.3 beta windows source installer. You can use the CLIPSDOS project and modify the main.c and userfunctions.c files that come with that since the project is set up to compile an unmanaged code. I notice there's a type in the code in the APG. The "Run(-1L)" code in the main function needs to have a semicolon added at the end.

       

Log in to post a comment.