Problem creating DetectNet object


I am doing object recognition on my Jetson TX2 and want to try DetectNet. I have problems creating an instance of the net.

This command parse the parameters to the class:

detectNet* net = detectNet::Create(prototxt_path, model_path, mean_pixel, threshold, DETECTNET_DEFAULT_INPUT, DETECTNET_DEFAULT_COVERAGE, DETECTNET_DEFAULT_BBOX, maxBatchSize);

But gives this error when compiling:
undefined reference to `detectNet

Can you help me?

I have followed the instructions for installing the Jetson Inference libraries:

Kind regards,


It looks like there is something incorrect in you implementation.
Do you include and build the detectNet class correctly?


Hi AastaLLL

I think I did it correctly.

  1. I downloaded the repository from here
  2. Then i build it using cmake.

The header files was placed in folder /build/aarch64/

  1. To test if the libraries was working I created a test file where I imported /build/aarch64/detectNet.h and created an instance and passed variables (.prototxt and more) to the constructor. Se below.

But. I got an error: undefined reference to detectNet

Do you see any mistakes?


#include “/home/nvidia/Desktop/neuralnetworks/objectDetection/detectNet/build/aarch64/include/detectNet.h”

using namespace std;

int main(){
const char * prototxt_path = “/home/nvidia/Desktop/neuralnetworks/objectDetection/caffenet_deploy.prototxt”;
const char * model_path = “/home/nvidia/Desktop/neuralnetworks/objectDetection/caffe_model.caffemodel”;
const char * mean_binary = “/home/nvidia/Desktop/neuralnetworks/objectDetection/mean.binaryproto”;
float threshold = 0.5f;
const char * input = “data”;
const char * coverage = “blob”;
const char * bboxes = “bboxes”;
const uint32_t maxBatchSize = 2;

detectNet* net = detectNet::Create(prototxt_path, model_path, mean_binary, threshold, DETECTNET_DEFAULT_INPUT, DETECTNET_DEFAULT_COVERAGE, DETECTNET_DEFAULT_BBOX, maxBatchSize);
cout << "works" << endl;



You need to link the
Here is an simple example for your reference:


#include "detectNet.h"

int main( int argc, char** argv )
    detectNet* net = detectNet::Create(argc, argv);
    return 0;


nvcc -std=c++11 topic_1038283.cpp -I[jetson_inferece]/build/aarch64/include/ -L[jetson_inferece]/build/aarch64/lib/ -ljetson-inference -o test




Ah yes, thanks!