diff --git a/.gitignore b/.gitignore
index f3b5a1fd965863d8bd307b3d7a80539d482ce2c4..ff3f1269350fe375b8e24d380213435e8d84f590 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 build.*
+spack*
 ./Generator/output/
 ./Generator/options/
diff --git a/Analysis/TrackInspect/CMakeLists.txt b/Analysis/TrackInspect/CMakeLists.txt
index fa42c0508250c1fb1f7e7f2afcb68c8452cbe3ce..a004d0104da456fb2225738b481141c285281122 100644
--- a/Analysis/TrackInspect/CMakeLists.txt
+++ b/Analysis/TrackInspect/CMakeLists.txt
@@ -5,6 +5,7 @@ gaudi_add_module(TrackInspect
                  LINK DataHelperLib 
                       Gaudi::GaudiKernel 
                       EDM4HEP::edm4hep 
+                      k4FWCore::k4FWCore
                       ${ROOT_LIBRARIES}
                       ${CLHEP_LIBRARIES}
 )
diff --git a/Detector/GeomSvc/src/GeomSvc.cpp b/Detector/GeomSvc/src/GeomSvc.cpp
index 878d60c81a117965f49b8139212b644f3cde95ba..54736e6c617c0e4c2591fd14817641751fe67f1e 100644
--- a/Detector/GeomSvc/src/GeomSvc.cpp
+++ b/Detector/GeomSvc/src/GeomSvc.cpp
@@ -125,7 +125,7 @@ const std::map<std::string,double>& GeomSvc::getDetParameters(std::string name){
   if(m_detParameters.find(name)!=m_detParameters.end()) return m_detParameters[name];
   else{
     char message[200];
-    sprintf(message,"GeomSvc has not the parameter set named %s", name); 
+    sprintf(message,"GeomSvc has not the parameter set named %s", name.c_str()); 
     throw std::runtime_error(message);
   }
 }
@@ -136,7 +136,7 @@ double GeomSvc::getDetParameter(std::string set_name, std::string par_name){
     if(it->second.find(par_name)!=it->second.end()) return it->second[par_name];  
   }
   char message[200];
-  sprintf(message,"GeomSvc has not the parameter named %s in set %s", par_name, set_name);
+  sprintf(message,"GeomSvc has not the parameter named %s in set %s", par_name.c_str(), set_name.c_str());
   throw std::runtime_error(message);
 }
 
diff --git a/Detector/GeomSvc/src/GeomSvc.h b/Detector/GeomSvc/src/GeomSvc.h
index 379d5b08e4e995a98ebfb49031967d56a6d0c69b..4ef39d2f0644c25b666145d4ee4a5caffd8420e1 100644
--- a/Detector/GeomSvc/src/GeomSvc.h
+++ b/Detector/GeomSvc/src/GeomSvc.h
@@ -19,7 +19,6 @@
 #include <gearimpl/ZPlanarParametersImpl.h>
 #include <gearimpl/GearParametersImpl.h>
 
-class dd4hep::DetElement;
 class TGeoNode;
 
 class GeomSvc: public extends<Service, IGeomSvc> {
diff --git a/Reconstruction/RecGenfitAlg/CMakeLists.txt b/Reconstruction/RecGenfitAlg/CMakeLists.txt
index 866156036919ed186102e28a6abfbd02938588fa..566801d154c2fb36a98a609303ade9b288e6cd01 100644
--- a/Reconstruction/RecGenfitAlg/CMakeLists.txt
+++ b/Reconstruction/RecGenfitAlg/CMakeLists.txt
@@ -19,6 +19,7 @@ gaudi_add_module(RecGenfitAlg
              EDM4HEP::edm4hep
              EDM4HEP::edm4hepDict
              GenFit::genfit2
+             k4FWCore::k4FWCore
 )
 
 target_include_directories(RecGenfitAlg PUBLIC
diff --git a/Reconstruction/Tracking/CMakeLists.txt b/Reconstruction/Tracking/CMakeLists.txt
index 5123c2922caa0f44e9346f3e11b8bc0710fb04ea..f3e77b4721987efb6a6cd5d7888f7455927bf61d 100644
--- a/Reconstruction/Tracking/CMakeLists.txt
+++ b/Reconstruction/Tracking/CMakeLists.txt
@@ -15,6 +15,7 @@ gaudi_add_module(Tracking
                       ${LCIO_LIBRARIES}
                       DetSegmentation
                       EDM4HEP::edm4hep EDM4HEP::edm4hepDict
+                      k4FWCore::k4FWCore
 )
 
 target_include_directories(Tracking PUBLIC
diff --git a/Service/GearSvc/src/GearSvc.h b/Service/GearSvc/src/GearSvc.h
index ad0e82b68a1ed605f06487d78b9a63ac519defb2..3048526cb9d0c477519599941006cefb9ee6f3fc 100644
--- a/Service/GearSvc/src/GearSvc.h
+++ b/Service/GearSvc/src/GearSvc.h
@@ -4,7 +4,6 @@
 #include "GearSvc/IGearSvc.h"
 #include <GaudiKernel/Service.h>
 #include "DD4hep/Detector.h"
-class dd4hep::DetElement;
 class TGeoNode;
 
 class GearSvc : public extends<Service, IGearSvc>
diff --git a/Simulation/DetSimAna/CMakeLists.txt b/Simulation/DetSimAna/CMakeLists.txt
index 794bcc2faab238a6196d8c8b949b98316b4add9a..883dfd8215c9ccfd9e88b7d1713c442de1f5e151 100644
--- a/Simulation/DetSimAna/CMakeLists.txt
+++ b/Simulation/DetSimAna/CMakeLists.txt
@@ -8,6 +8,7 @@ gaudi_add_module(DetSimAna
                       ${DD4hep_COMPONENT_LIBRARIES} 
                       Gaudi::GaudiKernel
                       EDM4HEP::edm4hep EDM4HEP::edm4hepDict
+                      k4FWCore::k4FWCore
 )
 
 install(TARGETS DetSimAna
diff --git a/Simulation/DetSimCore/CMakeLists.txt b/Simulation/DetSimCore/CMakeLists.txt
index 9c225fc7332999dc1bd7ca9088a33d8b6b0e46f9..933406ceb023dc43651c0b025a471d2f80056f8d 100644
--- a/Simulation/DetSimCore/CMakeLists.txt
+++ b/Simulation/DetSimCore/CMakeLists.txt
@@ -20,6 +20,7 @@ gaudi_add_module(DetSimCore
                       Gaudi::GaudiKernel
                       ${Geant4_LIBRARIES}
                       ${DD4hep_COMPONENT_LIBRARIES} 
+                      k4FWCore::k4FWCore
                       EDM4HEP::edm4hep EDM4HEP::edm4hepDict
 )
 
diff --git a/Utilities/KalDet/CMakeLists.txt b/Utilities/KalDet/CMakeLists.txt
index 12fbb25371c389078d6787aff43cbda32f07b8cd..3b7497713d64ebe552de5104a6edbb095c64b560 100644
--- a/Utilities/KalDet/CMakeLists.txt
+++ b/Utilities/KalDet/CMakeLists.txt
@@ -72,6 +72,8 @@ gaudi_add_library(KalDetLib
                        ${GEAR_LIBRARIES} 
                        EDM4HEP::edm4hep EDM4HEP::edm4hepDict
                        ${DD4hep_COMPONENT_LIBRARIES}
+                       GenFit::genfit2
+
 )
 
 install(TARGETS KalDetLib