0

I'm trying to make GTK frontend and CLIPS backend work together in sync. The structure of my app is as follows:

  1. CLIPSWindow class contains the GUI code of the app.

  2. GTKClips contains the c++ wrappers around the common CLIPS constructs.

  3. Main app instantiates a design from Glade GUI designer and runs it using Gtk::kit

here is a link to my github repo. The files of importance are GTKClips.{h,cpp}, clipswindow.{h,cpp} and main_app.cpp.

To put the question more clearly: How do I instantiate a member of GTKClips class so that it can be used by clipswindow class to send and receive data. Should I pass it as a parameter to the constructor of clipswindow and then use it in the class or something else?

  • Can you point me to the original question? – Ankit Kulshrestha Nov 30 '16 at 22:24
  • The CLIPS files have .c extensions. Are you using the appropriate option for compiling them as C++ files? – Gary Riley Nov 30 '16 at 23:16
  • Since the C functions are wrapped around C++ wrappers, I didn't include that option. I'm trying to get the GtkCLIPS(my backend) to talk to the GTKWindow subclass. Since you're one of the core devs of CLIPS, can I contact you? – Ankit Kulshrestha Nov 30 '16 at 23:19
  • GtkCLIPS.cpp includes GtkCLIPS.h which includes clips.h. Unless you wrap the clips.h include within an extern "C" block, the names will be mangled during the C++ file compilation and the linker will not be able to find the functions if the corresponding source file is compiled as C code. If you're mixing C++ code with code that's both valid C and C++ code, the simplest solution is to compile everything as C++. Support emails for CLIPS are at http://www.clipsrules.net/?q=Support. – Gary Riley Dec 01 '16 at 06:05

0 Answers0