title: Thread 1 "my_app" received signal SIGSEGV, Segmentation fault when accessing API from another library
body: <p>From my C++ application my_app compiled using G++, I am invoking several API's from another shared library tool.so (tool.so also developed using C++). Each reference of API call from tool.so I am getting the below segmentation fault from the GDB.</p>
  <pre><code>Thread 1 &quot;my_app&quot; received signal SIGSEGV, Segmentation fault.
  0x00007ffff61406cd in boost::filesystem::detail::status(boost::filesystem::path const&amp;, boost::system::error_code\*) () from /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1
  </code></pre>
  <p>problem seem to be boost version mismatch. myapp needs boost 1.65 but tool.so compiled using boost 1.55. I am statically linking both and get segmentation error. I modified the CmakeList.txt, so that it dynamically links my_app, tool. but still I get the same segmentation error. any suggestion?</p>
  <p>CmakeLists.txt
  add_library(tool SHARED IMPORTED)
  set_target_properties(tool PROPERTIES IMPORTED_LOCATION ${TOOL_LIB_DIR}/tool.so)
  target_link_libraries(my_app PRIVATE tool)</p>
  <pre><code>Thread 1 &quot;my_app&quot; received signal SIGSEGV, Segmentation fault.
  0x00007ffff61406cd in boost::filesystem::detail::status(boost::filesystem::path const&amp;, boost::system::error_code\*) () from /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1
  </code></pre>
  <pre><code>    int main(int argc, const char* argv[])
      {
      ..  
      if(TOOL_Initialize() == TOOL_FAIL)    ----&gt; Call 1 
      {
        std::cout &lt;&lt;&quot; failed to initialize.\n&quot;;
      } 
      ..
      ..
      ..
      
      if(TOOL_DEVICE_GetCount(DEVICE_TYPE)!= TOOL_SUCCESS)--&gt; call 2
      { 
       cout &lt;&lt; &quot;Get CPU count API failed exiting&quot; &lt;&lt; endl ; 
      }
  }    
  </code></pre>
  <p>Getting segmentation fault in call 1, if comment out call 1 then getting in call 2 wherever I am invoking lib call</p>