Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails with opencv-git [edited] #126

Closed
TomasBedrnik opened this issue Oct 13, 2016 · 10 comments
Closed

Compilation fails with opencv-git [edited] #126

TomasBedrnik opened this issue Oct 13, 2016 · 10 comments

Comments

@TomasBedrnik
Copy link

Hi,
I'm trying to compile rtabmap on Archlinux, but it fails:
error: ‘class std::unordered_map<unsigned int, std::vector<unsigned int> >’ has no member named ‘serialize’
I tried git and 0.11.8 version - both same probem. I have gcc 6.2.1 and boost 1.61.0.

cmake-output.txt
make-output.txt

I don't know if the problem is in my system or rtabmap has issues with some of new version of libraries in my system.

Thanks
Tomas

@matlabbe
Copy link
Member

The error is FLANN related, which uses std::unordered_map objects. Can you tell me if you are able to build standalone flann-1.8.4-src?

In lsh_table.h, there is this code:

// TODO as soon as we use C++0x, use the code in USE_UNORDERED_MAP
#if USE_UNORDERED_MAP
#include <unordered_map>
#else
#include <map>
#endif

When rtabmap is building, USE_UNORDERED_MAP is not defined, so I guess you could try to set #define USE_UNORDERED_MAP 1 just before these lines:

// TODO as soon as we use C++0x, use the code in USE_UNORDERED_MAP
#define USE_UNORDERED_MAP 1
#if USE_UNORDERED_MAP
#include <unordered_map>
#else
#include <map>
#endif

cheers

@TomasBedrnik
Copy link
Author

Thanks for fast reply.

This path is needed to compile flann: http://pkgs.fedoraproject.org/cgit/rpms/flann.git/plain/flann-1.8.4-gcc6.patch and some aditional changes for python bindings.

Unfortunately adding #define USE_UNORDERED_MAP 1 didn't change anything.

@matlabbe
Copy link
Member

I tried with Fedora and gcc 6.2.1, and with default binaries available (e.g. pcl-devel). Minor this issue, it builds correctly with this config:

-- --------------------------------------------
-- Info :
--   Version : 0.11.11
--   CMAKE_INSTALL_PREFIX = /usr/local
--   CMAKE_BUILD_TYPE =     Release
--   CMAKE_INSTALL_LIBDIR = lib
--   BUILD_APP =            ON
--   BUILD_TOOLS =          ON
--   BUILD_EXAMPLES =       ON
--   BUILD_SHARED_LIBS =    ON
--   CMAKE_CXX_FLAGS =  -fmessage-length=0  -fopenmp
--   With OpenCV 2 nonfree module (SIFT/SURF) = NO (not found, License: BSD)
--   With Freenect             = NO (libfreenect not found)
--   With OpenNI2              = NO (OpenNI2 not found)
--   With Freenect2            = NO (libfreenect2 not found)
--   With dc1394               = NO (dc1394 not found)
--   With FlyCapture2/Triclops = NO (Point Grey SDK not found)
--   With TORO                 = YES (License: Creative Commons [Attribution-NonCommercial-ShareAlike])
--   With g2o                  = NO (WITH_G2O=OFF)
--   With GTSAM                = NO (GTSAM not found)
--   With VERTIGO              = YES (License: GPLv3)
--   With cvsba                = NO (cvsba not found)
--   With ZED                  = NO (ZED sdk not found)
--   With RealSense            = NO (librealsense not found)
--   With OCTOMAP              = YES (License: BSD)
--   With Qt4                  = YES (License: Open Source or Commercial)
-- --------------------------------------------

However, if I build with g2o, the -std=c++11 flag is added to compilation instructions, and then the build fails with Openni errors like these:

/usr/include/ni/XnCppWrapper.h: In constructor ‘xn::Context::Context()’:
/usr/include/ni/XnCppWrapper.h:8658:40: error: class ‘xn::Context’ does not have any field named ‘m_bUsingDeprecatedAPI’
   inline Context() : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL) {}
                                        ^~~~~~~~~~~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h:8658:70: error: class ‘xn::Context’ does not have any field named ‘m_bAllocated’
   inline Context() : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL) {}
                                                                      ^~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h: In constructor ‘xn::Context::Context(XnContext*)’:
/usr/include/ni/XnCppWrapper.h:8665:59: error: class ‘xn::Context’ does not have any field named ‘m_bUsingDeprecatedAPI’
   inline Context(XnContext* pContext) : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL)
                                                           ^~~~~~~~~~~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h:8665:89: error: class ‘xn::Context’ does not have any field named ‘m_bAllocated’
   inline Context(XnContext* pContext) : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL)
                                                                                         ^~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h: In copy constructor ‘xn::Context::Context(const xn::Context&)’:
/usr/include/ni/XnCppWrapper.h:8676:60: error: class ‘xn::Context’ does not have any field named ‘m_bUsingDeprecatedAPI’
   inline Context(const Context& other) : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL)
                                                            ^~~~~~~~~~~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h:8676:90: error: class ‘xn::Context’ does not have any field named ‘m_bAllocated’
   inline Context(const Context& other) : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL)
                                                                                          ^~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h: In static member function ‘static void xn::Context::FreeLicensesList(XnLicense*)’:
/usr/include/ni/XnCppWrapper.h:8955:32: error: ‘xnFreeLicensesList’ was not declared in this scope
    xnFreeLicensesList(aLicenses);
                                ^
/usr/include/ni/XnCppWrapper.h: In member function ‘void xn::Context::UnregisterFromErrorStateChange(XnCallbackHandle)’:
/usr/include/ni/XnCppWrapper.h:9256:64: error: ‘xnUnregisterFromGlobalErrorStateChange’ was not declared in this scope
    xnUnregisterFromGlobalErrorStateChange(m_pContext, hCallback);
                                                                ^
/usr/include/ni/XnCppWrapper.h: In member function ‘void xn::Context::UnregisterFromNodeCreation(XnCallbackHandle)’:
/usr/include/ni/XnCppWrapper.h:9295:81: error: ‘xnUnregisterFromNodeCreation’ was not declared in this scope
    xnUnregisterFromNodeCreation(m_pContext, pCreationCookie->hUnderlyingCallback);
                                                                                 ^
/usr/include/ni/XnCppWrapper.h:9296:28: error: ‘xnOSFree’ was not declared in this scope
    xnOSFree(pCreationCookie);
                            ^
/usr/include/ni/XnCppWrapper.h: In member function ‘void xn::Context::UnregisterFromNodeDestruction(XnCallbackHandle)’:
/usr/include/ni/XnCppWrapper.h:9335:87: error: ‘xnUnregisterFromNodeDestruction’ was not declared in this scope
    xnUnregisterFromNodeDestruction(m_pContext, pDestructionCookie->hUnderlyingCallback);
                                                                                       ^
/usr/include/ni/XnCppWrapper.h:9336:31: error: ‘xnOSFree’ was not declared in this scope
    xnOSFree(pDestructionCookie);
                               ^
/usr/include/ni/XnCppWrapper.h: In member function ‘void xn::Context::SetHandle(XnContext*)’:
/usr/include/ni/XnCppWrapper.h:9498:9: error: ‘m_bUsingDeprecatedAPI’ was not declared in this scope
     if (m_bUsingDeprecatedAPI && m_bAllocated)
         ^~~~~~~~~~~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h:9498:34: error: ‘m_bAllocated’ was not declared in this scope
     if (m_bUsingDeprecatedAPI && m_bAllocated)
                                  ^~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h:9502:32: error: ‘xnForceShutdown’ was not declared in this scope
      xnForceShutdown(m_pContext);
                                ^
/usr/include/ni/XnCppWrapper.h:9506:73: error: ‘xnContextUnregisterFromShutdown’ was not declared in this scope
      xnContextUnregisterFromShutdown(m_pContext, m_hShuttingDownCallback);
                                                                         ^
/usr/include/ni/XnCppWrapper.h:9507:33: error: ‘xnContextRelease’ was not declared in this scope
      xnContextRelease(m_pContext);
                                 ^
/usr/include/ni/XnCppWrapper.h:9513:5: error: ‘XnStatus’ was not declared in this scope
     XnStatus nRetVal = xnContextAddRef(pContext);
     ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9514:15: error: ‘nRetVal’ was not declared in this scope
     XN_ASSERT(nRetVal == XN_STATUS_OK);
               ^~~~~~~
In file included from /usr/include/ni/XnStatusCodes.h:27:0,
                 from /usr/include/ni/XnMacros.h:27,
                 from /usr/include/ni/XnOS.h:28,
                 from /usr/include/pcl-1.8/pcl/io/openni_camera/openni.h:47,
                 from /usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:44,
                 from /home/mathieu/rtabmap/corelib/src/../include/rtabmap/core/CameraRGBD.h:41,
                 from /home/mathieu/rtabmap/corelib/src/CameraThread.cpp:31:
/usr/include/ni/XnCppWrapper.h:9514:26: error: expected ‘)’ before numeric constant
     XN_ASSERT(nRetVal == XN_STATUS_OK);
                          ^
In file included from /usr/include/pcl-1.8/pcl/io/openni_camera/openni.h:50:0,
                 from /usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:44,
                 from /home/mathieu/rtabmap/corelib/src/../include/rtabmap/core/CameraRGBD.h:41,
                 from /home/mathieu/rtabmap/corelib/src/CameraThread.cpp:31:
/usr/include/ni/XnCppWrapper.h:9517:113: error: ‘xnContextRegisterForShutdown’ was not declared in this scope
 al = xnContextRegisterForShutdown(pContext, ContextShuttingDownCallback, this, &m_hShuttingDownCallback);
                                                                                                        ^
In file included from /usr/include/ni/XnStatusCodes.h:27:0,
                 from /usr/include/ni/XnMacros.h:27,
                 from /usr/include/ni/XnOS.h:28,
                 from /usr/include/pcl-1.8/pcl/io/openni_camera/openni.h:47,
                 from /usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:44,
                 from /home/mathieu/rtabmap/corelib/src/../include/rtabmap/core/CameraRGBD.h:41,
                 from /home/mathieu/rtabmap/corelib/src/CameraThread.cpp:31:
/usr/include/ni/XnCppWrapper.h:9518:26: error: expected ‘)’ before numeric constant
     XN_ASSERT(nRetVal == XN_STATUS_OK);
                          ^
In file included from /usr/include/pcl-1.8/pcl/io/openni_camera/openni.h:50:0,
                 from /usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:44,
                 from /home/mathieu/rtabmap/corelib/src/../include/rtabmap/core/CameraRGBD.h:41,
                 from /home/mathieu/rtabmap/corelib/src/CameraThread.cpp:31:
/usr/include/ni/XnCppWrapper.h: In member function ‘void xn::Context::TakeOwnership(XnContext*)’:
/usr/include/ni/XnCppWrapper.h:9530:30: error: ‘xnContextRelease’ was not declared in this scope
     xnContextRelease(pContext);
                              ^
/usr/include/ni/XnCppWrapper.h: In member function ‘int xn::Context::Shutdown()’:
/usr/include/ni/XnCppWrapper.h:9585:26: error: ‘xnShutdown’ was not declared in this scope
     xnShutdown(m_pContext);
                          ^
/usr/include/ni/XnCppWrapper.h: In member function ‘int xn::Context::NodeCreationCallback(XnContext*, XnNodeHandle, void*)’:
/usr/include/ni/XnCppWrapper.h:9625:25: error: ‘struct xn::Context::NodeCreationCookie’ has no member named ‘pFunc’
    pNodeCreationCookie->pFunc(context, createdNode, pNodeCreationCookie->pCookie);
                         ^~~~~
/usr/include/ni/XnCppWrapper.h: In member function ‘int xn::Context::NodeDestructionCallback(XnContext*, const int*, void*)’:
/usr/include/ni/XnCppWrapper.h:9632:25: error: ‘struct xn::Context::NodeDestructionCookie’ has no member named ‘pFunc’
    pNodeCreationCookie->pFunc(context, strDestroyedNodeName, pNodeCreationCookie->pCookie);
                         ^~~~~
/usr/include/ni/XnCppWrapper.h: At global scope:
/usr/include/ni/XnCppWrapper.h:9672:30: error: expected ‘)’ before ‘xRes’
   inline Resolution(XnUInt32 xRes, XnUInt32 yRes) : m_nXRes(xRes), m_nYRes(yRes)
                              ^~~~
/usr/include/ni/XnCppWrapper.h:9683:27: error: ‘XnChar’ does not name a type
   inline Resolution(const XnChar* strName)
                           ^~~~~~
/usr/include/ni/XnCppWrapper.h:9698:10: error: ‘XnUInt32’ does not name a type
   inline XnUInt32 GetXResolution() const { return m_nXRes; }
          ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9702:10: error: ‘XnUInt32’ does not name a type
   inline XnUInt32 GetYResolution() const { return m_nYRes; }
          ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9706:16: error: ‘XnChar’ does not name a type
   inline const XnChar* GetName() const { return m_strName; }
                ^~~~~~
/usr/include/ni/XnCppWrapper.h:9710:3: error: ‘XnUInt32’ does not name a type
   XnUInt32 m_nXRes;
   ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9711:3: error: ‘XnUInt32’ does not name a type
   XnUInt32 m_nYRes;
   ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9712:9: error: ‘XnChar’ does not name a type
   const XnChar* m_strName;
         ^~~~~~
/usr/include/ni/XnCppWrapper.h: In constructor ‘xn::Resolution::Resolution(XnResolution)’:
/usr/include/ni/XnCppWrapper.h:9661:4: error: ‘m_nXRes’ was not declared in this scope
    m_nXRes = xnResolutionGetXRes(res);
    ^~~~~~~
/usr/include/ni/XnCppWrapper.h:9661:37: error: ‘xnResolutionGetXRes’ was not declared in this scope
    m_nXRes = xnResolutionGetXRes(res);
                                     ^
/usr/include/ni/XnCppWrapper.h:9662:4: error: ‘m_nYRes’ was not declared in this scope
    m_nYRes = xnResolutionGetYRes(res);
    ^~~~~~~
/usr/include/ni/XnCppWrapper.h:9662:37: error: ‘xnResolutionGetYRes’ was not declared in this scope
    m_nYRes = xnResolutionGetYRes(res);
                                     ^
/usr/include/ni/XnCppWrapper.h:9663:4: error: ‘m_strName’ was not declared in this scope
    m_strName = xnResolutionGetName(res);
    ^~~~~~~~~
/usr/include/ni/XnCppWrapper.h:9663:39: error: ‘xnResolutionGetName’ was not declared in this scope
    m_strName = xnResolutionGetName(res);
                                       ^
/usr/include/ni/XnCppWrapper.h: In constructor ‘xn::Resolution::Resolution(const int*)’:
/usr/include/ni/XnCppWrapper.h:9685:43: error: ‘xnResolutionGetFromName’ was not declared in this scope
    m_Res = xnResolutionGetFromName(strName);
                                           ^
/usr/include/ni/XnCppWrapper.h:9686:4: error: ‘m_nXRes’ was not declared in this scope
    m_nXRes = xnResolutionGetXRes(m_Res);
    ^~~~~~~
/usr/include/ni/XnCppWrapper.h:9686:39: error: ‘xnResolutionGetXRes’ was not declared in this scope
    m_nXRes = xnResolutionGetXRes(m_Res);
                                       ^
/usr/include/ni/XnCppWrapper.h:9687:4: error: ‘m_nYRes’ was not declared in this scope
    m_nYRes = xnResolutionGetYRes(m_Res);
    ^~~~~~~
/usr/include/ni/XnCppWrapper.h:9687:39: error: ‘xnResolutionGetYRes’ was not declared in this scope
    m_nYRes = xnResolutionGetYRes(m_Res);
                                       ^
/usr/include/ni/XnCppWrapper.h:9688:4: error: ‘m_strName’ was not declared in this scope
    m_strName = xnResolutionGetName(m_Res);
    ^~~~~~~~~
/usr/include/ni/XnCppWrapper.h:9688:41: error: ‘xnResolutionGetName’ was not declared in this scope
    m_strName = xnResolutionGetName(m_Res);
                                         ^
/usr/include/ni/XnCppWrapper.h: At global scope:
/usr/include/ni/XnCppWrapper.h:9718:9: error: ‘XnStatus’ does not name a type
  inline XnStatus NodeInfoList::FilterList(Context& context, Query& query)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h: In member function ‘void xn::ProductionNode::GetContext(xn::Context&) const’:
/usr/include/ni/XnCppWrapper.h:9725:66: error: ‘xnGetRefContextFromNodeHandle’ was not declared in this scope
   context.TakeOwnership(xnGetRefContextFromNodeHandle(GetHandle()));
                                                                  ^
/usr/include/ni/XnCppWrapper.h: In member function ‘xn::Context xn::ProductionNode::GetContext() const’:
/usr/include/ni/XnCppWrapper.h:9730:66: error: ‘xnGetRefContextFromNodeHandle’ was not declared in this scope
   XnContext* pContext = xnGetRefContextFromNodeHandle(GetHandle());
                                                                  ^
/usr/include/ni/XnCppWrapper.h:9732:28: error: ‘xnContextRelease’ was not declared in this scope
   xnContextRelease(pContext);
                            ^
/usr/include/ni/XnCppWrapper.h: In member function ‘xn::NodeInfoList& xn::NodeInfo::GetNeededNodes() const’:
/usr/include/ni/XnCppWrapper.h:9740:60: error: ‘xnNodeInfoGetNeededNodes’ was not declared in this scope
    XnNodeInfoList* pList = xnNodeInfoGetNeededNodes(m_pInfo);
                                                            ^
/usr/include/ni/XnCppWrapper.h: In member function ‘void xn::NodeInfo::SetUnderlyingObject(XnNodeInfo*)’:
/usr/include/ni/XnCppWrapper.h:9754:3: error: ‘m_bOwnerOfNode’ was not declared in this scope
   m_bOwnerOfNode = FALSE;
   ^~~~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h: At global scope:
/usr/include/ni/XnCppWrapper.h:9759:9: error: ‘XnBool’ does not name a type
  inline XnBool FrameSyncCapability::CanFrameSyncWith(Generator& other) const
         ^~~~~~
/usr/include/ni/XnCppWrapper.h:9764:9: error: ‘XnStatus’ does not name a type
  inline XnStatus FrameSyncCapability::FrameSyncWith(Generator& other)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9769:9: error: ‘XnStatus’ does not name a type
  inline XnStatus FrameSyncCapability::StopFrameSyncWith(Generator& other)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9774:9: error: ‘XnBool’ does not name a type
  inline XnBool FrameSyncCapability::IsFrameSyncedWith(Generator& other) const
         ^~~~~~
/usr/include/ni/XnCppWrapper.h:9779:9: error: ‘XnStatus’ does not name a type
  inline XnStatus NodeInfo::GetInstance(ProductionNode& node) const
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9801:9: error: ‘XnStatus’ does not name a type
  inline XnStatus Device::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9810:9: error: ‘XnStatus’ does not name a type
  inline XnStatus Recorder::Create(Context& context, const XnChar* strFormatName /*= NULL*/)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9819:9: error: ‘XnStatus’ does not name a type
  inline XnStatus Player::Create(Context& context, const XnChar* strFormatName)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9828:9: error: ‘XnStatus’ does not name a type
  inline XnStatus DepthGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9837:9: error: ‘XnStatus’ does not name a type
  inline XnStatus MockDepthGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9846:9: error: ‘XnStatus’ does not name a type
  inline XnStatus MockDepthGenerator::CreateBasedOn(DepthGenerator& other, const XnChar* strName /* = NULL */)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9857:9: error: ‘XnStatus’ does not name a type
  inline XnStatus ImageGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9866:9: error: ‘XnStatus’ does not name a type
  inline XnStatus MockImageGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9875:9: error: ‘XnStatus’ does not name a type
  inline XnStatus MockImageGenerator::CreateBasedOn(ImageGenerator& other, const XnChar* strName /* = NULL */)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9886:9: error: ‘XnStatus’ does not name a type
  inline XnStatus IRGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9895:9: error: ‘XnStatus’ does not name a type
  inline XnStatus MockIRGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9904:9: error: ‘XnStatus’ does not name a type
  inline XnStatus MockIRGenerator::CreateBasedOn(IRGenerator& other, const XnChar* strName /* = NULL */)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9915:9: error: ‘XnStatus’ does not name a type
  inline XnStatus GestureGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9924:9: error: ‘XnStatus’ does not name a type
  inline XnStatus SceneAnalyzer::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9934:9: error: ‘XnStatus’ does not name a type
  inline XnStatus HandsGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9943:9: error: ‘XnStatus’ does not name a type
  inline XnStatus UserGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9952:9: error: ‘XnStatus’ does not name a type
  inline XnStatus AudioGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9961:9: error: ‘XnStatus’ does not name a type
  inline XnStatus MockAudioGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9970:9: error: ‘XnStatus’ does not name a type
  inline XnStatus MockAudioGenerator::CreateBasedOn(AudioGenerator& other, const XnChar* strName /* = NULL */)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9981:9: error: ‘XnStatus’ does not name a type
  inline XnStatus MockRawGenerator::Create(Context& context, const XnChar* strName /*= NULL*/)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9990:9: error: ‘XnStatus’ does not name a type
  inline XnStatus Codec::Create(Context& context, XnCodecID codecID, ProductionNode& initializerNode)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:9999:9: error: ‘XnStatus’ does not name a type
  inline XnStatus ScriptNode::Run(EnumerationErrors* pErrors)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:10004:9: error: ‘XnStatus’ does not name a type
  inline XnStatus ScriptNode::Create(Context& context, const XnChar* strFormat)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:10017:31: error: variable or field ‘XN_API_DEPRECATED’ declared void
  inline void XN_API_DEPRECATED("Use xn::Version::Current() instead") GetVersion(XnVersion& Version)
                               ^
/usr/include/ni/XnCppWrapper.h:10029:54: error: expected ‘)’ before ‘handler’
   StateChangedCallbackTranslator(StateChangedHandler handler, void* pCookie) : m_UserHandler(handler), m_pUserCookie(pCookie), m_hCallback(NULL) {}
                                                      ^~~~~~~
/usr/include/ni/XnCppWrapper.h:10031:3: error: ‘XnStatus’ does not name a type
   XnStatus Register(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode)
   ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:10041:10: error: ‘XnStatus’ does not name a type
   static XnStatus RegisterToUnderlying(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
          ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:10060:10: error: ‘XnStatus’ does not name a type
   static XnStatus UnregisterFromUnderlying(_XnUnregisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, XnCallbackHandle hCallback)
          ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:10073:4: error: ‘StateChangedHandler’ does not name a type
    StateChangedHandler userHandler;
    ^~~~~~~~~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h:10078:15: error: variable or field ‘XN_CALLBACK_TYPE’ declared void
   static void XN_CALLBACK_TYPE StateChangedCallback(XnNodeHandle hNode, void* pCookie)
               ^~~~~~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h:10078:15: error: expected ‘;’ at end of member declaration
/usr/include/ni/XnCppWrapper.h:10085:3: error: ‘StateChangedHandler’ does not name a type
   StateChangedHandler m_UserHandler;
   ^~~~~~~~~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h: In member function ‘int xn::StateChangedCallbackTranslator::StateChangedCallback(XnNodeHandle, void*)’:
/usr/include/ni/XnCppWrapper.h:10082:12: error: ‘class xn::StateChangedCallbackTranslator’ has no member named ‘m_UserHandler’
    pTrans->m_UserHandler(node, pTrans->m_pUserCookie);
            ^~~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h: At global scope:
/usr/include/ni/XnCppWrapper.h:10090:9: error: ‘XnStatus’ does not name a type
  static XnStatus _RegisterToStateChange(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h: In function ‘void xn::_UnregisterFromStateChange(xn::_XnUnregisterStateChangeFuncPtr, XnNodeHandle, XnCallbackHandle)’:
/usr/include/ni/XnCppWrapper.h:10097:3: error: ‘UnregisterFromUnderlying’ is not a member of ‘xn::StateChangedCallbackTranslator’
   StateChangedCallbackTranslator::UnregisterFromUnderlying(xnFunc, hNode, hCallback);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ni/XnCppWrapper.h: At global scope:
/usr/include/ni/XnCppWrapper.h:10100:9: error: ‘XnStatus’ does not name a type
  inline XnStatus GeneralIntCapability::RegisterToValueChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
         ^~~~~~~~
/usr/include/ni/XnCppWrapper.h: In member function ‘void xn::GeneralIntCapability::UnregisterFromValueChange(XnCallbackHandle)’:
/usr/include/ni/XnCppWrapper.h:10122:54: error: ‘m_strCap’ was not declared in this scope
   xnUnregisterFromGeneralIntValueChange(GetHandle(), m_strCap, pTrans->m_hCallback);
                                                      ^~~~~~~~
/usr/include/ni/XnCppWrapper.h:10122:83: error: ‘xnUnregisterFromGeneralIntValueChange’ was not declared in this scope
   xnUnregisterFromGeneralIntValueChange(GetHandle(), m_strCap, pTrans->m_hCallback);
                                                                                   ^
In file included from /home/mathieu/rtabmap/corelib/src/../include/rtabmap/core/CameraRGBD.h:41:0,
                 from /home/mathieu/rtabmap/corelib/src/CameraThread.cpp:31:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h: At global scope:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:71:116: error: ‘XnUInt64’ has not been declared
 age (boost::shared_ptr<xn::DepthMetaData> depth_meta_data, float baseline, float focal_length, XnUInt64 shadow_value, XnUInt64 no_sample_value) throw ();
                                                                                                ^~~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:71:139: error: ‘XnUInt64’ has not been declared
 xn::DepthMetaData> depth_meta_data, float baseline, float focal_length, XnUInt64 shadow_value, XnUInt64 no_sample_value) throw ();
                                                                                                ^~~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:127:14: error: ‘XnUInt64’ does not name a type
       inline XnUInt64
              ^~~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:133:14: error: ‘XnUInt64’ does not name a type
       inline XnUInt64
              ^~~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:161:7: error: ‘XnUInt64’ does not name a type
       XnUInt64 shadow_value_;
       ^~~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:162:7: error: ‘XnUInt64’ does not name a type
       XnUInt64 no_sample_value_;
       ^~~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:165:117: error: ‘XnUInt64’ has not been declared
 age (boost::shared_ptr<xn::DepthMetaData> depth_meta_data, float baseline, float focal_length, XnUInt64 shadow_value, XnUInt64 no_sample_value) throw ()
                                                                                                ^~~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:165:140: error: ‘XnUInt64’ has not been declared
 xn::DepthMetaData> depth_meta_data, float baseline, float focal_length, XnUInt64 shadow_value, XnUInt64 no_sample_value) throw ()
                                                                                                ^~~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h: In constructor ‘openni_wrapper::DepthImage::DepthImage(boost::shared_ptr<xn::DepthMetaData>, float, float, int, int)’:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:169:5: error: class ‘openni_wrapper::DepthImage’ does not have any field named ‘shadow_value_’
   , shadow_value_ (shadow_value)
     ^~~~~~~~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:170:5: error: class ‘openni_wrapper::DepthImage’ does not have any field named ‘no_sample_value_’
   , no_sample_value_ (no_sample_value) { }
     ^~~~~~~~~~~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h: At global scope:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:192:3: error: ‘XnUInt64’ does not name a type
   XnUInt64
   ^~~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:198:3: error: ‘XnUInt64’ does not name a type
   XnUInt64
   ^~~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h: In member function ‘unsigned int openni_wrapper::DepthImage::getWidth() const’:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:207:23: error: ‘class xn::DepthMetaData’ has no member named ‘XRes’
     return depth_md_->XRes ();
                       ^~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h: In member function ‘unsigned int openni_wrapper::DepthImage::getHeight() const’:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:213:23: error: ‘class xn::DepthMetaData’ has no member named ‘YRes’
     return depth_md_->YRes ();
                       ^~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h: In member function ‘unsigned int openni_wrapper::DepthImage::getFrameID() const’:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:219:23: error: ‘class xn::DepthMetaData’ has no member named ‘FrameID’
     return depth_md_->FrameID ();
                       ^~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h: In member function ‘long unsigned int openni_wrapper::DepthImage::getTimeStamp() const’:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_depth_image.h:225:51: error: ‘class xn::DepthMetaData’ has no member named ‘Timestamp’
     return static_cast<unsigned long> (depth_md_->Timestamp ());
                                                   ^~~~~~~~~
In file included from /home/mathieu/rtabmap/corelib/src/../include/rtabmap/core/CameraRGBD.h:42:0,
                 from /home/mathieu/rtabmap/corelib/src/CameraThread.cpp:31:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_image.h: In member function ‘void openni_wrapper::Image::fillRaw(unsigned char*) const’:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_image.h:121:38: error: ‘class xn::ImageMetaData’ has no member named ‘Data’
       memcpy (rgb_buffer, image_md_->Data (), image_md_->DataSize ());
                                      ^~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_image.h:121:58: error: ‘class xn::ImageMetaData’ has no member named ‘DataSize’
       memcpy (rgb_buffer, image_md_->Data (), image_md_->DataSize ());
                                                          ^~~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_image.h: In member function ‘unsigned int openni_wrapper::Image::getWidth() const’:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_image.h:181:23: error: ‘class xn::ImageMetaData’ has no member named ‘XRes’
     return image_md_->XRes ();
                       ^~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_image.h: In member function ‘unsigned int openni_wrapper::Image::getHeight() const’:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_image.h:187:23: error: ‘class xn::ImageMetaData’ has no member named ‘YRes’
     return image_md_->YRes ();
                       ^~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_image.h: In member function ‘unsigned int openni_wrapper::Image::getFrameID() const’:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_image.h:193:23: error: ‘class xn::ImageMetaData’ has no member named ‘FrameID’
     return image_md_->FrameID ();
                       ^~~~~~~
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_image.h: In member function ‘long unsigned int openni_wrapper::Image::getTimeStamp() const’:
/usr/include/pcl-1.8/pcl/io/openni_camera/openni_image.h:199:51: error: ‘class xn::ImageMetaData’ has no member named ‘Timestamp’
     return static_cast<unsigned long> (image_md_->Timestamp ());

Did you have these errors too? Did you build PCL from source (along with Openni)?

@TomasBedrnik
Copy link
Author

I have never seen this errors.
I have pcl-1.8.0 and openni-2.2beta2 from source (AUR builds). I disabled most dependencies, tried older gcc-5.4, older boost-1.54, recompiled pcl, disabled openni2... but errors with serialize remains same with some new ones.

@TomasBedrnik
Copy link
Author

Openni2 fails to build with gcc6 - needs to be build with clang. But serialize errors remains even without openni2.

@matlabbe
Copy link
Member

For an ugly solution, serialize related code can be commented, it is not used.

@TomasBedrnik
Copy link
Author

Thanks, that works.
If I figure out how to solve this problem without this ugly hack, I'll let you know.

@TomasBedrnik
Copy link
Author

I don't know what the problem was, but it is working now. Versions of gcc and boost are the same.

@TomasBedrnik TomasBedrnik changed the title Compilation fails on Archlinux Compilation fails with opencv-git [edited] Nov 19, 2016
@TomasBedrnik
Copy link
Author

TomasBedrnik commented Nov 19, 2016

I found the probem. It is in current git version of opencv. With 3.1.0 it works OK, but probmem is this commit to opencv/opencv@e42750c associated to this issue: opencv/opencv#7027

It basically adds #include "opencv2/flann.hpp" to include/opencv2/opencv.hpp
Opencv has own copy of flann 1.6.10 and this #include probably covers system version of flann (last is 1.8.4).

I don't know if this should be solved in opencv (use newer flann) or rtabmap (some cmake magic?)

@TomasBedrnik TomasBedrnik reopened this Nov 19, 2016
matlabbe added a commit that referenced this issue Nov 23, 2016
…ne name to avoid conflicts with the one defined in OpenCV
@matlabbe
Copy link
Member

RTAB-Map uses a slightly patched version of the latest flann library (1.8). The problem is similar to flann-lib/flann#214

OpenCV is using #define USE_UNORDERED_MAP 1, and since the define name is the same as the flann included in rtabmap, USE_UNORDERED_MAP was set to 1, making rtabmap compilation failing with unordered_map serialization errors. It seems that even the latest flann code (this version tested) cannot be built with USE_UNORDERED_MAP=1. The commit above fixes the problem.

Well, OpenCV is using USE_UNORDERED_MAP=1 for a long time, I think that the commit you referred is making the lsh_table.h header file included in rtabmap somehow, setting the define to 1.

cheers,
Mathieu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants