1

I wanted to control the raspberry pi camera with MMAL and I used the RaspiCamControl.c file to learn how to control the camera component then I wrote a class about it. I've created and added all the functions that I needed. In this file (RaspiCamControl.c), there are two function calls at the lines between 1741 to 1766 from interface/vmcs_host/vc_vchi_gencmd.h which are vc_gencmd(char *, int, char const *, ...) and vc_gencmd_number_property(char *, char const *, int *). I can see their declaration at the vc_vchi_gencmd.h file but when I want to build, Qt is giving errors about these functions references are undefined.

Here is my pro file;

INCLUDEPATH += /home/orkun/rpi/sysroot/opt/vc/include \
           /home/orkun/rpi/sysroot/opt/vc/include/interface/vmcs_host \
           /home/orkun/rpi/sysroot/opt/vc/include/interface/vcos/pthreads \
           /home/orkun/rpi/sysroot/opt/vc/include/interface/vmcs_host/linux

LIBS += -L/home/orkun/rpi/sysroot/opt/vc/lib

LIBS += -lbcm_host
LIBS += -lbrcmEGL
LIBS += -lbrcmGLESv2
LIBS += -lbrcmOpenVG
LIBS += -lbrcmWFC
LIBS += -lcontainers
LIBS += -ldebug_sym
LIBS += -ldebug_sym_static
LIBS += -ldtovl
LIBS += -lEGL
LIBS += -lEGL_static
LIBS += -lelftoolchain
LIBS += -lGLESv1_CM
LIBS += -lGLESv2
LIBS += -lGLESv2_static
LIBS += -lkhrn_client
LIBS += -lkhrn_static
LIBS += -lmmal
LIBS += -lmmal_components
LIBS += -lmmal_core
LIBS += -lmmal_util
LIBS += -lmmal_vc_client
LIBS += -lopenmaxil
LIBS += -lOpenVG
LIBS += -lvcfiled_check
LIBS += -lvchiq_arm
LIBS += -lvchostif
LIBS += -lvcilcs
LIBS += -lvcsm
LIBS += -lvcos
LIBS += -lWFC

LIBS += -pthread

These are all the libraries (except pthread) at the /opt/vc/libs folder. I'm searched about the error but found nothing on the google. I'm a bit confused, should I implement these functions? Or, is there any other library at somewhere else?

Thanks. Sorry for my bad English.

EDIT: The error disappears when include the related file with;

extern "C"
{
    #include "interface/vmcs_host/vc_vchi_gencmd.h"
}

I don't know this is the right way to that but error is gone now. Should I delete the question?

1 Answers1

1

Undefined reference errors have gone when include the vc_vchi_gencmd.h file with extern "C"... declaration;

extern "C"
{
    #include "interface/vmcs_host/vc_vchi_gencmd.h"
}