Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `caffe::Datum::Datum()' when integrating with QT? #1924

Closed
helxsz opened this issue Feb 21, 2015 · 1 comment
Closed

Comments

@helxsz
Copy link

helxsz commented Feb 21, 2015

I am new to caffe, I have installed caffe and run the examples successfully, but now I am trying to integrate caffe with QT based application. My environment is ubuntu 14.04. Assume the CAFFE_ROOT as the caffe root folder, CAFFE_ROOT/build is the folder to put the compiled files.

to configure the QT based application, include path and library path needs to be configured.In the CAFFE_ROOT/build, I can find the lib folder where libcaffe.so library can be found and src folder for the include path

therefore the .pro is looking like as below

INCLUDEPATH += /usr/include \
                /usr/local/include \
              /CAFFE_ROOT/build/src
LIBS += -L/usr/lib \
         -lglog \
         -lgflags \
         -llmdb \
         -lprotobuf \
        -L/CAFFE_ROOT/build/lib
         -lcaffe

in my c++ application,

#include <QCoreApplication>
#include<iostream>
#include <fstream>
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <google/protobuf/text_format.h>
#include <lmdb.h>
#include <sys/stat.h>
#include <caffe/proto/caffe.pb.h>
using namespace caffe;
using namespace std;
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    Datum datum;
    datum.set_channels(1);
    return a.exec();
}

when compiling, it gives me a error , * error: undefined reference to `caffe::Datum::Datum()' *

(sorry I am back in China for a month, could not log into google forum so far)

@helxsz helxsz changed the title could not find include path of caffe when integrating with QT? undefined reference to `caffe::Datum::Datum()' when integrating with QT? Feb 21, 2015
@helxsz helxsz closed this as completed Feb 21, 2015
@patrickhuie19
Copy link

solution??
I have this problem too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants