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 <jacopo@mondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
b4935e9a4d
commit
b99da21657
1 changed files with 2 additions and 5 deletions
|
@ -1,13 +1,10 @@
|
|||
#include <iostream>
|
||||
|
||||
namespace libcamera {
|
||||
#include <libcamera/libcamera.h>
|
||||
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
void init_lib(void)
|
||||
void libcamera::init_lib(void)
|
||||
{
|
||||
cout << "Lib Camera Init" << endl;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue