diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index 4e94819a076c3d372c070bd949265544af0c9a8a..a392ff614693e0cba62a64757decfbb14506f895 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -138,7 +138,8 @@ set (COMMON_LIB_SRC_FILES
   ConfigurationFile.cpp
   SourcedParameter.cpp   
   Timer.cpp
-  UserIdentity.cpp)
+  UserIdentity.cpp
+  optional.cpp)
 
 add_library (ctacommon SHARED
   ${COMMON_LIB_SRC_FILES})
diff --git a/common/optional.cpp b/common/optional.cpp
index c17d6ff9ffc73f65d90448a82f89e5d45e0cfa67..8aa3389c1782a4ce63c86fdb776fb428195630c1 100644
--- a/common/optional.cpp
+++ b/common/optional.cpp
@@ -23,4 +23,8 @@
 
 #include "optional.hpp"
 
-nullopt_t nullopt{};
+namespace cta{
+
+const cta::nullopt_t nullopt{};
+
+}
\ No newline at end of file
diff --git a/common/optional.hpp b/common/optional.hpp
index db9f7cccd2aff7b72d78e84b0194384ac54172b8..364ac870bd0211221018f8894d6adf7b4293eaf0 100644
--- a/common/optional.hpp
+++ b/common/optional.hpp
@@ -28,7 +28,7 @@ struct nullopt_t {
     nullopt_t() {}
 };
 
-extern nullopt_t nullopt;
+extern const nullopt_t nullopt;
 
 template <class T> class optional
 {