diff --git a/daemon/src/cc_config.h b/daemon/src/cc_config.h
index 8da77b2325bd74ef88b1e095d0eeb083f3c71555..5f391d0b809c104b0423c7d1dbacd2429670ab0e 100644
--- a/daemon/src/cc_config.h
+++ b/daemon/src/cc_config.h
@@ -37,8 +37,10 @@
 
 #ifdef CCPP_PREFIX
 #include <cc++/config.h>
-#else
+#elif defined COMMONCPP_PREFIX
 #include <commoncpp/config.h>
+#else
+#error No CCGNU2 include directory found.
 #endif
 
 #endif // CC_CONFIG_H_
diff --git a/daemon/src/cc_thread.h b/daemon/src/cc_thread.h
index 4af48e2e82ceb0eb862cd04a5003dcfd6383293b..fbbaf277e5c08b203ddfdc15374097b37e420a9b 100644
--- a/daemon/src/cc_thread.h
+++ b/daemon/src/cc_thread.h
@@ -37,8 +37,10 @@
 
 #ifdef CCPP_PREFIX
 #include <cc++/thread.h> // for mutex
-#else
+#elif defined COMMONCPP_PREFIX
 #include <commoncpp/thread.h> // for mutex
+#else
+#error No CCGNU2 include directory found.
 #endif
 
 #endif	// CC_THREAD_H_