title: Error compiling a cpp file (ros)
body: <p>I'm working on knowrob package and I already wrote my ontology(XML file) with Protege. 
  If I parse the owl.file and send some queries I have right answers. 
  Now my problem is to make a cpp to parse my xml file.
  I already read something about json_prolog to send queries from my program to knowrob but is too muddler(<a href="http://www.knowrob.org/doc/interact_with_knowrob_via_ros" rel="nofollow">http://www.knowrob.org/doc/interact_with_knowrob_via_ros</a>).
  I create my launch file and it works,later when i try to compile this cpp file:</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;ros/ros.h&gt;
  #include &lt;json_prolog/prolog.h&gt;
  using namespace std;
  using namespace json_prolog;
  int main(int argc, char *argv[])
  {
      ros::init(argc, argv, "test_json_prolog");
      Prolog pl;
      PrologQueryProxy bdgs = pl.query("member(A, [1, 2, 3, 4]), B = ['x', A],             C = foo(bar, A, B)");
  
      for(PrologQueryProxy::iterator it=bdgs.begin();
  
      it != bdgs.end(); it++)
      {
          PrologBindings bdg = *it;
          cout &lt;&lt; "Found solution: " &lt;&lt; (bool)(it == bdgs.end()) &lt;&lt; endl;
          cout &lt;&lt; "A = "&lt;&lt; bdg["A"] &lt;&lt; endl;
          cout &lt;&lt; "B = " &lt;&lt; bdg["B"] &lt;&lt; endl;
          cout &lt;&lt; "C = " &lt;&lt; bdg["C"] &lt;&lt; endl;
      }
      return 0;
  }code here
  </code></pre>
  
  <p>I have the error:</p>
  
  <pre><code>/tmp/cccLQk3H.o:test_json_prolog.cpp:function main: error: undefined reference to 'ros::init(int&amp;, char**, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, unsigned int)'
  </code></pre>
  
  <p>and other similar error about the undefined reference.</p>
  
  <p>CMakelist :</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8.3)
  project(json_prolog)
  find_package(catkin REQUIRED rosjava_build_tools roscpp rospy json_prolog_msgs)
  catkin_rosjava_setup(installApp publishMavenJavaPublicationToMavenRepository writeClasspath)
  install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_MAVEN_DESTINATION}/org/knowrob/${PROJECT_NAME}/
      DESTINATION ${CATKIN_GLOBAL_MAVEN_DESTINATION}/org/knowrob/${PROJECT_NAME})
  catkin_package(INCLUDE_DIRS include LIBRARIES json_prolog CATKIN_DEPENDS json_prolog_msgs )
  
  
  # find SWI Prolog libraries
  include(FindPkgConfig)
  pkg_check_modules(SWIPL REQUIRED swipl)
  include_directories(${SWIPL_INCLUDE_DIRS})
  link_directories(${SWIPL_LIBRARY_DIRS})
  
  # export Python libraries
  catkin_python_setup()
  
  # C++ client library
  
  include_directories(include ${catkin_INCLUDE_DIRS})
  find_package(PkgConfig)
  pkg_check_modules(JSON_GLIB REQUIRED json-glib-1.0)
  add_definitions(${JSON_GLIB_CFLAGS})
  link_directories(${JSON_GLIB_LIBRARIY_DIRS})
  </code></pre>
  
  <p>How can I solve it?</p>