For some reason I keep getting complaints about undefined reference to jpeg functions.
root@localhost:/usr/src/jetson_multimedia_api/samples/05_jpeg_encode# make
Compiling: jpeg_encode_csvparser.cpp
Compiling: jpeg_encode_main.cpp
make[1]: Entering directory '/usr/src/jetson_multimedia_api/samples/common/classes'
Compiling: NvApplicationProfiler.cpp
Compiling: NvBuffer.cpp
Compiling: NvBufSurface.cpp
Compiling: NvDrmRenderer.cpp
Compiling: NvEglRenderer.cpp
Compiling: NvElement.cpp
Compiling: NvElementProfiler.cpp
Compiling: NvJpegDecoder.cpp
Compiling: NvJpegEncoder.cpp
Compiling: NvLogging.cpp
Compiling: NvUtils.cpp
Compiling: NvV4l2Element.cpp
Compiling: NvV4l2ElementPlane.cpp
Compiling: NvVideoDecoder.cpp
Compiling: NvVideoEncoder.cpp
make[1]: Leaving directory '/usr/src/jetson_multimedia_api/samples/common/classes'
Linking: jpeg_encode
/usr/bin/ld: /usr/src/jetson_multimedia_api/samples/common/classes/NvJpegDecoder.o: in function `NvJPEGDecoder::NvJPEGDecoder(char const*)':
NvJpegDecoder.cpp:(.text+0x64): undefined reference to `jpeg_std_error'
/usr/bin/ld: NvJpegDecoder.cpp:(.text+0x84): undefined reference to `jpeg_CreateDecompress'
/usr/bin/ld: /usr/src/jetson_multimedia_api/samples/common/classes/NvJpegDecoder.o: in function `NvJPEGDecoder::~NvJPEGDecoder()':
NvJpegDecoder.cpp:(.text+0x194): undefined reference to `jpeg_destroy_decompress'
/usr/bin/ld: /usr/src/jetson_multimedia_api/samples/common/classes/NvJpegDecoder.o: in function `NvJPEGDecoder::decodeToFd(int&, unsigned char*, unsigned long, unsigned int&, unsigned int&, unsigned int&)':
NvJpegDecoder.cpp:(.text+0x4ec): undefined reference to `jpeg_mem_src'
/usr/bin/ld: NvJpegDecoder.cpp:(.text+0x508): undefined reference to `jpeg_read_header'
/usr/bin/ld: NvJpegDecoder.cpp:(.text+0x5b0): undefined reference to `jpeg_start_decompress'
/usr/bin/ld: NvJpegDecoder.cpp:(.text+0x714): undefined reference to `jpeg_read_raw_data'
/usr/bin/ld: NvJpegDecoder.cpp:(.text+0x720): undefined reference to `jpeg_finish_decompress'
/usr/bin/ld: /usr/src/jetson_multimedia_api/samples/common/classes/NvJpegDecoder.o: in function `NvJPEGDecoder::decodeToBuffer(NvBuffer**, unsigned char*, unsigned long, unsigned int*, unsigned int*, unsigned int*)':
NvJpegDecoder.cpp:(.text+0xc94): undefined reference to `jpeg_mem_src'
/usr/bin/ld: NvJpegDecoder.cpp:(.text+0xcb0): undefined reference to `jpeg_read_header'
/usr/bin/ld: NvJpegDecoder.cpp:(.text+0xdc0): undefined reference to `jpeg_start_decompress'
/usr/bin/ld: NvJpegDecoder.cpp:(.text+0xfc4): undefined reference to `jpeg_finish_decompress'
/usr/bin/ld: /usr/src/jetson_multimedia_api/samples/common/classes/NvJpegDecoder.o: in function `NvJPEGDecoder::decodeIndirect(NvBuffer*, unsigned int)':
NvJpegDecoder.cpp:(.text+0x14b4): undefined reference to `jpeg_read_raw_data'
/usr/bin/ld: /usr/src/jetson_multimedia_api/samples/common/classes/NvJpegDecoder.o: in function `NvJPEGDecoder::decodeDirect(NvBuffer*, unsigned int)':
NvJpegDecoder.cpp:(.text+0x1e20): undefined reference to `jpeg_read_raw_data'
/usr/bin/ld: /usr/src/jetson_multimedia_api/samples/common/classes/NvJpegEncoder.o: in function `NvJPEGEncoder::NvJPEGEncoder(char const*)':
NvJpegEncoder.cpp:(.text+0x64): undefined reference to `jpeg_std_error'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x84): undefined reference to `jpeg_CreateCompress'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x94): undefined reference to `jpeg_suppress_tables'
/usr/bin/ld: /usr/src/jetson_multimedia_api/samples/common/classes/NvJpegEncoder.o: in function `NvJPEGEncoder::~NvJPEGEncoder()':
NvJpegEncoder.cpp:(.text+0x198): undefined reference to `jpeg_destroy_compress'
/usr/bin/ld: /usr/src/jetson_multimedia_api/samples/common/classes/NvJpegEncoder.o: in function `NvJPEGEncoder::encodeFromFd(int, J_COLOR_SPACE, unsigned char**, unsigned long&, int)':
NvJpegEncoder.cpp:(.text+0x4b4): undefined reference to `jpeg_mem_dest'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x4f0): undefined reference to `jpeg_set_defaults'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x504): undefined reference to `jpeg_set_quality'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x52c): undefined reference to `jpeg_set_hardware_acceleration_parameters_enc'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x558): undefined reference to `jpeg_start_compress'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x834): undefined reference to `jpeg_write_raw_data'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x840): undefined reference to `jpeg_finish_compress'
/usr/bin/ld: /usr/src/jetson_multimedia_api/samples/common/classes/NvJpegEncoder.o: in function `NvJPEGEncoder::encodeFromBuffer(NvBuffer&, J_COLOR_SPACE, unsigned char**, unsigned long&, int)':
NvJpegEncoder.cpp:(.text+0xab8): undefined reference to `jpeg_mem_dest'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x112c): undefined reference to `jpeg_set_defaults'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x1140): undefined reference to `jpeg_set_quality'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x1168): undefined reference to `jpeg_set_hardware_acceleration_parameters_enc'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x1194): undefined reference to `jpeg_set_colorspace'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x14a0): undefined reference to `jpeg_start_compress'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x173c): undefined reference to `jpeg_write_raw_data'
/usr/bin/ld: NvJpegEncoder.cpp:(.text+0x176c): undefined reference to `jpeg_finish_compress'
collect2: error: ld returned 1 exit status
make: *** [Makefile:53: jpeg_encode] Error 1
I have looked up the relevant library and header file :
sudo find / -name libnvjpeg.so
/usr/lib/aarch64-linux-gnu/nvidia/libnvjpeg.so
sudo find / -name nvjpeg.h
/usr/local/cuda-12.9/targets/aarch64-linux/include/nvjpeg.h
Not sure if it has anything to do with the non-matching cuda versions ;
Wed Jun 25 10:31:49 2025
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 540.4.0 Driver Version: 540.4.0 CUDA Version: 12.6 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 Orin (nvgpu) N/A | N/A N/A | N/A |
| N/A N/A N/A N/A / N/A | Not Supported | N/A N/A |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| No running processes found |
+---------------------------------------------------------------------------------------+