3dtof/voxelsdk

DepthCameraLibrary::getABIVersion() returns incorrect value

Opened this issue · 0 comments

Hi, I've built SDK from sources and I've got Ignoring Voxel library warnings caused by ABI versions mismatch.
It looks like there is an error in DepthCameraLibrary::getABIVersion() method part for LINUX.
A proper solution could be something like:

--- a/Voxel/DepthCameraLibrary.cpp
+++ b/Voxel/DepthCameraLibrary.cpp
@@ -190,12 +190,20 @@ int DepthCameraLibrary::getABIVersion()
   
   ELFIO::dynamic_section_accessor d(reader, dynamicSection);
     
-  ELFIO::Elf_Xword tag = DT_SONAME, value;
+  ELFIO::Elf_Xword tag, value;
     
   String soName;
-    
-  if(!d.get_entry(0, tag, value, soName))
-  {
+  bool hasSoname = false;  
+
+  for(int i = 0; i < d.get_entries_num(); i++) {
+
+    if (d.get_entry(i, tag, value, soName) && tag == DT_SONAME)
+    {
+      hasSoname = true;
+      break;
+    }
+  }
+  if (!hasSoname) {
     logger(LOG_DEBUG) << "DepthCameraLibrary: Could not find SONAME in " << _libName << std::endl;
     return 0;
   }