# undefined reference to \`createInferBuilder\_INTERNAL' whe I run sampleOnnxMNIST.cpp 

**URL:** <https://forums.developer.nvidia.com/t/undefined-reference-to-createinferbuilder-internal-whe-i-run-sampleonnxmnist-cpp/70266>\
**Category:** TensorRT\
**Created:** [February 8, 2019, 4:23am UTC](https://forums.developer.nvidia.com/t/undefined-reference-to-createinferbuilder-internal-whe-i-run-sampleonnxmnist-cpp/70266 "2019-02-08T04:23:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhruvildarji1409](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@dhruvildarji1409](https://forums.developer.nvidia.com/u/dhruvildarji1409)\
**Post date:** [February 8, 2019, 4:23am UTC](https://forums.developer.nvidia.com/t/undefined-reference-to-createinferbuilder-internal-whe-i-run-sampleonnxmnist-cpp/70266/1 "2019-02-08T04:23:21Z")

</div>

I am using TensorRT5 with Jetson Xavier. I am passing cuda and tensorrt dependencies.

g++ new\_file.cpp -I/usr/local/cuda/include -I/usr/src/tensorrt/samples/common -std=c++11

Below is the whole log of Errors:

adas\_vehicle@adas:/usr/src/tensorrt/samples/sampleOnnxMNIST$ sudo g++ sampleOnnxMNIST.cpp -I/usr/local/cuda/include -I/usr/src/tensorrt/samples/common -std=c++11  
[sudo] password for adas\_vehicle:  
/tmp/cc7ZwYbJ.o: In function `nvinfer1::(anonymous namespace)::createInferBuilder(nvinfer1::ILogger&)': sampleOnnxMNIST.cpp:(.text+0x19): undefined reference to `createInferBuilder\_INTERNAL’  
/tmp/cc7ZwYbJ.o: In function `nvinfer1::(anonymous namespace)::createInferRuntime(nvinfer1::ILogger&)': sampleOnnxMNIST.cpp:(.text+0x38): undefined reference to `createInferRuntime\_INTERNAL’  
/tmp/cc7ZwYbJ.o: In function `nvonnxparser::(anonymous namespace)::createParser(nvinfer1::INetworkDefinition&, nvinfer1::ILogger&)': sampleOnnxMNIST.cpp:(.text+0x62): undefined reference to `createNvOnnxParser\_INTERNAL’  
/tmp/cc7ZwYbJ.o: In function `doInference(nvinfer1::IExecutionContext&, float*, float*, int)': sampleOnnxMNIST.cpp:(.text+0x47f): undefined reference to `cudaMalloc’  
sampleOnnxMNIST.cpp:(.text+0x4de): undefined reference to `cudaMalloc' sampleOnnxMNIST.cpp:(.text+0x514): undefined reference to `cudaStreamCreate’  
sampleOnnxMNIST.cpp:(.text+0x576): undefined reference to `cudaMemcpyAsync' sampleOnnxMNIST.cpp:(.text+0x606): undefined reference to `cudaMemcpyAsync’  
sampleOnnxMNIST.cpp:(.text+0x63c): undefined reference to `cudaStreamSynchronize' sampleOnnxMNIST.cpp:(.text+0x648): undefined reference to `cudaStreamDestroy’  
sampleOnnxMNIST.cpp:(.text+0x65a): undefined reference to `cudaFree' sampleOnnxMNIST.cpp:(.text+0x696): undefined reference to `cudaFree’  
collect2: error: ld returned 1 exit status

---

<div class="post-metadata">

**Author:** ![NVES](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nves/32/14043_2.png) [@NVES](https://forums.developer.nvidia.com/u/NVES)\
**Post date:** [February 25, 2019, 2:16am UTC](https://forums.developer.nvidia.com/t/undefined-reference-to-createinferbuilder-internal-whe-i-run-sampleonnxmnist-cpp/70266/2 "2019-02-25T02:16:01Z")

</div>

Hello,

Looks like you are not linking cuda and tensorrt correctly. Since you are usng the onnxMNIST sample, please reference the associated makefile and makefile.config for how to -l the appropriate libraries and -i the necessary header files.
