Unable to Build jetson_multimedia_api/samples

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                                                           |
+---------------------------------------------------------------------------------------+

Hi,
Please share more information. Do you use developer kit or a custom board? Do you use Jetpack 6.2?

Generally if you use SDKManager to flash developer kit, and install the samples by running:

$ sudo apt update
$ sudo apt install nvidia-l4t-jetson-multimedia-api

The samples shall be compiled without issue.

I’m using the nvidia jetson orin nano developer kit. I didn’t use the SDKManager to flash the developer kit, but I did use Jetpack 6.2 flashed to the SD Card.

cat /etc/nv_tegra_release
# R36 (release), REVISION: 4.3, GCID: 38968081, BOARD: generic, EABI: aarch64, DATE: Wed Jan  8 01:49:37 UTC 2025
# KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia

also

nvidia-l4t-jetson-multimedia-api is already the newest version (36.4.3-20250107174145)

Hi,
We can build the samples successfully by running the steps:

  1. Follow Quick Start — NVIDIA Jetson Linux Developer Guide The flash command is
> Jetson Orin Nano Developer Kit (SD card):

$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device mmcblk0p1 \
  -c tools/kernel_flash/flash_l4t_t234_nvme.xml -p "-c bootloader/generic/cfg/flash_t234_qspi.xml" \
  --showlogs --network usb0 jetson-orin-nano-devkit internal
  1. Boot to Ubuntu and run
$ sudo apt update
$ sudo apt install nvidia-l4t-jetson-multimedia-api
  1. Build the sample
$ cd /usr/src/jetson_multimedia_api/samples/05_jpeg_encode
$ sudo make

Both 05 and 06 samples can be successfully built. Please give it a try.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.