The error message you're encountering indicates that the libAIDABach.so shared library failed to load due to an undefined symbol. The symbol in question appears to be related to the dd4hep library, specifically an AlignmentsCollector template instantiation involving dd4hep::Alignment.
Here's a step-by-step approach to troubleshoot and potentially resolve this issue:
Check Dependencies: Ensure all the necessary libraries that libAIDABach.so depends on are correctly linked and available. The missing symbol points to dd4hep, so you should verify that dd4hep is correctly installed and the version is compatible with libAIDABach.so.
Verify Linker Flags: Ensure that the linking process of libAIDABach.so includes the correct linker flags for dd4hep. In your CMakeLists.txt or build script, make sure that libraries like dd4hep are properly linked.
Check for Undefined Symbols in dd4hep: The undefined symbol _ZNK6dd4hep5align19AlignmentsCollectorISt6vectorINS_9AlignmentESaIS3_EEEclENS_10DetElementEi needs to be defined in one of the dd4hep libraries. You can use tools like nm or objdump to check if the symbol is available in the dd4hep library files you've linked against.
Rebuild Libraries: Sometimes, rebuilding the dependent libraries can clear up undefined symbols, especially if there were changes in their interfaces. Try rebuilding dd4hep and then rebuild libAIDABach.
CMake Configuration: Make sure your CMake configuration is set up to find the dd4hep library and headers correctly. Often issues arise from CMake not finding the correct paths. You may need to set variables like CMAKE_PREFIX_PATH, CMAKE_INCLUDE_PATH, or CMAKE_LIBRARY_PATH to point to the locations of dd4hep.
Check for Missing or Wrong Version Libraries: Ensure that there are no mismatches or missing libraries. You should have the correct version of dd4hep that includes the required symbols. Sometimes the loader might be picking up an older version of a library.
Run-time Library Path: Ensure the runtime library path includes the path to the dd4hep libraries. You might need to set the LD_LIBRARY_PATH environment variable: