From b99da21657d4f6bad415a87b82ac0d9c738018e7 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Fri, 30 Nov 2018 10:54:26 +0000 Subject: lib: Fix class and namespace usage The (dummy) init_lib function was linking correctly only due to a namespace 'collision' adding the init_lib to libcamera namespace, which is 'shared' by class libcamera. The init function was designed to be a class member function of the libcamera object - and is used as such in the existing test function. Instead of relying on the namespace collision - update the lib/main.cpp example file to correctly utilise the class header - and specify the function declaration, so that further implementations do not fall into the same bad habits. Reported-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- lib/main.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/main.cpp b/lib/main.cpp index 7b3da269..37f1ccce 100644 --- a/lib/main.cpp +++ b/lib/main.cpp @@ -1,13 +1,10 @@ #include - -namespace libcamera { +#include using std::cout; using std::endl; -void init_lib(void) +void libcamera::init_lib(void) { cout << "Lib Camera Init" << endl; } - -}; -- cgit v1.2.1