Undefined reference to affdex::CameraDetector


#1

Hello everyone,

I’ve been trying to use Emotion SDK on Ubuntu, but can’t seem to figure out how. I can’t create a CameraDetector, these two lines produce undefined reference errors:

 affdex::CameraDetector detector(0,15,1,2,affdex::FaceDetectorMode::LARGE_FACES);
 detector.setClassifierPath(classifierPath);

Any ideas why that is? Thanks.


#2

Hi, can you provide the exact text of the error? Thanks.


#3

/home/tylnesh/devel/ERecognition/datacollectiondialog.cpp:245: error: undefined reference to `affdex::CameraDetector::CameraDetector(int, double, double, unsigned int, affdex::FaceDetectorMode)’

/home/tylnesh/devel/ERecognition/datacollectiondialog.cpp:247: error: undefined reference to `affdex::Detector::setClassifierPath(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)’

/home/tylnesh/devel/ERecognition/datacollectiondialog.cpp:245: undefined reference to `affdex::CameraDetector::~CameraDetector()’

/home/tylnesh/devel/ERecognition/datacollectiondialog.cpp:245: undefined reference to `affdex::CameraDetector::~CameraDetector()’

collect2: error: ld returned 1 exit status

Thank you.


#4

are you #include-ing CameraDetector.h?


#6

Yes, these are my includes:

#include “datacollectiondialog.h”
#include “ui_datacollectiondialog.h”
#include “nzmqtsubscriber.h”
#include “3rdparty/cppzmq/zmq.hpp”
#include <qmsgpack/msgpack.h>
#include <QtSerialPort/QtSerialPort>

#include <Frame.h>
#include <Face.h>
#include <FrameDetector.h>
#include <AffdexException.h>
#include <FaceListener.h>
#include <CameraDetector.h>
#include <ImageListener.h>
#include “afacelistener.h”


#7

oh, wait, those are linker errors above, right? Are you linking to affdex-native.so?


#8

Oh, stupid me, thanks! That was it. There’s stil an undefined reference to affdex::Detector::setClassifierPath though.


#9

Hmm, that’s weird. I don’t have an idea on that one, sorry.


#10

Ok, but I have another problem. For some reason, when I start the detector in the same way as it’s done in the tutorial I get:

HIGHGUI WARNING: V4L/V4L2: VIDIOC_S_CROP
terminate called without an active exception
Aborted (core dumped)

Any ideas?