error while installing libjasper-dev package on debian 12 (bookworm)

hello, i want to ask when i try to install libjasper-dev package on debian 12 (bookworm) i get this error "-- Could not find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR) "
1 Reply
nour_oud
nour_oud•7mo ago
Hi @big-D, the libjasper-dev package is not properly installed, or the CMake configuration is unable to locate the Jasper library and its header files. These steps may help you: 1- ensure that the libjasper-dev package is installed:
sudo apt update
sudo apt install libjasper-dev
sudo apt update
sudo apt install libjasper-dev
2- After installation, verify that the necessary files are present:
ls /usr/lib/x86_64-linux-gnu/libjasper.so
ls /usr/include/jasper/jasper.h
ls /usr/lib/x86_64-linux-gnu/libjasper.so
ls /usr/include/jasper/jasper.h
3- If the files are present but CMake still cannot find them, you might need to set the environment variables to help CMake locate the library:
export JASPER_LIBRARIES=/usr/lib/x86_64-linux-gnu/libjasper.so
export JASPER_INCLUDE_DIR=/usr/include/jasper
export JASPER_LIBRARIES=/usr/lib/x86_64-linux-gnu/libjasper.so
export JASPER_INCLUDE_DIR=/usr/include/jasper
then reload the shell configuration:
source ~/.bashrc
source ~/.bashrc
4- If setting environment variables is not sufficient configure CMake with Hints:
cmake -DJASPER_LIBRARIES=/usr/lib/x86_64-linux-gnu/libjasper.so -DJASPER_INCLUDE_DIR=/usr/include/jasper /path/to/your/project
cmake -DJASPER_LIBRARIES=/usr/lib/x86_64-linux-gnu/libjasper.so -DJASPER_INCLUDE_DIR=/usr/include/jasper /path/to/your/project
5- now ensure that your CMake configuration includes a module to find Jasper:
find_path(JASPER_INCLUDE_DIR NAMES jasper/jasper.h)
find_library(JASPER_LIBRARIES NAMES jasper)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Jasper DEFAULT_MSG JASPER_LIBRARIES JASPER_INCLUDE_DIR)

mark_as_advanced(JASPER_LIBRARIES JASPER_INCLUDE_DIR)
find_path(JASPER_INCLUDE_DIR NAMES jasper/jasper.h)
find_library(JASPER_LIBRARIES NAMES jasper)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Jasper DEFAULT_MSG JASPER_LIBRARIES JASPER_INCLUDE_DIR)

mark_as_advanced(JASPER_LIBRARIES JASPER_INCLUDE_DIR)
6- run CMake to see if it successfully finds the Jasper library 👀 :
cmake /path/to/your/project
cmake /path/to/your/project
and you can consult the package documentation for better guidance
Want results from more Discord servers?
Add your server