Unable to get camera connection for root users [Ubuntu 18.04], LoadImageFile, CVB2019

Hi All

I’m capable to run the c api with no issues however when I’m trying to run it with root privileges I’m stuck in the LoadImageFile function which always returns false.

for example:

    CvbHelperBase* cvbHelper = nullptr;

    const size_t SIZE = 256;
    char fileNamePath[SIZE] = { 0 };
    if (!TranslateFileName("/opt/cvb/drivers/GenICam.vin", fileNamePath, SIZE)){
       return cvbHelper;
    }

    IMG img = nullptr;
    if (!LoadImageFile(fileNamePath, img)){
        return cvbHelper;
    }

   //continue the code

The above it does work with normal user, but no for root. I need to run my app as a root user. Does anyone know how I can deal with this issue?

Thanks in advance

Hi @mmolero, I think this should be the environment variables. In admin mode we only propagate a minimal set for configuration.

In general we advise against running as admin. But I can look up the file to change tomorrow.

Thanks, it is right!

If we add

LD_LIBRARY_PATH=CVB=/opt/cvb,GENICAM_GENTL64_PATH=/opt/cvb/drivers/genicam,CVGENICAM_REGISTRY=/var/opt/cvb/Registry,VTE_VERSION=5202,IM_CONFIG_PHASE=2,GENICAM_CACHE_V3_1=/var/opt/cvb/genicam,CVBDATA=/var/opt/cvb,CVBCONFIG=/etc/opt/cvb

it is working now.

Thanks!