diff --git a/robot/sample-vpRobotCamera.cpp b/robot/sample-vpRobotCamera.cpp index 38ccdd8..d0da5bc 100644 --- a/robot/sample-vpRobotCamera.cpp +++ b/robot/sample-vpRobotCamera.cpp @@ -1,3 +1,6 @@ +#include + +#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS #include #ifdef ENABLE_VISP_NAMESPACE @@ -28,3 +31,12 @@ int main() robot.getPosition(cMw); // Position of the camera wrt the world frame std::cout << "New position of the camera cMw:\n" << cMw << std::endl; } +#else +#include + +int main() +{ + std::cout << "This example requires compiling ViSP with the deprecated functions." << std::endl; + return EXIT_SUCCESS; +} +#endif diff --git a/sensor/sample-vpRealSense-4.cpp b/sensor/sample-vpRealSense-4.cpp index 6b66f1d..15e78ef 100644 --- a/sensor/sample-vpRealSense-4.cpp +++ b/sensor/sample-vpRealSense-4.cpp @@ -53,7 +53,7 @@ // Using a thread to display the pointcloud with PCL produces a segfault on OSX #if( ! defined(__APPLE__) && ! defined(__MACH__) ) // Not OSX -# if (defined(VISP_HAVE_PTHREAD) || defined(_WIN32)) // Threading available +# if (defined(VISP_HAVE_PTHREAD) || defined(_WIN32)) && VISP_BUILD_DEPRECATED_FUNCTIONS // vpThread and vpMutex available # define USE_THREAD # endif #endif @@ -63,8 +63,13 @@ # include #endif +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + #ifdef VISP_HAVE_PCL #ifdef USE_THREAD + // Shared vars typedef enum { @@ -75,11 +80,6 @@ typedef enum t_CaptureState s_capture_state = capture_waiting; vpMutex s_mutex_capture; - -#ifdef ENABLE_VISP_NAMESPACE -using namespace VISP_NAMESPACE_NAME; -#endif - vpThread::Return displayPointcloudFunction(vpThread::Args args) { pcl::PointCloud::Ptr pointcloud_ = *((pcl::PointCloud::Ptr *) args);