Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) libjpeg.so.8: cannot open shared object file: No such file or directory

 

Misc error.

 

 

 

 

 

Full error message

 

Starting /MyProject...
/MyProject: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory
/MyProject exited with code 127

 

 

 

 

 

 

Cause

 

Operating system: Ubuntu 10.04 LTS Lucid Lynx

IDE: Qt Creator 1.3.1

Project type: Qt4 Console Application

Selected required modules: QtCore

Compiler: G++ 4.4.1

Boost version: 1.42.0

Additional libraries: jpeg-8a from the Independent JPEG Group

 

The following source code was used:

 

#include <boost/gil/gil_all.hpp>
#include <boost/gil/extension/io/jpeg_io.hpp>

int main()
{
  using namespace boost::gil;
  rgb8_image_t img;
  jpeg_read_image("test.jpg",img);
}

 

The following project file was used:

 

#-------------------------------------------------
#
# Project created by QtCreator 2010-05-02T08:31:54
#
#-------------------------------------------------
QT -= gui
TARGET = MyProject
CONFIG += console
CONFIG -= app_bundle
INCLUDEPATH += ../../../boost_1_42_0 ../../../jpeg-8a
TEMPLATE = app
SOURCES += main.cpp
LIBS += -L/usr/local/lib -ljpeg

 

 

 

 

 

Solution

 

(Murat Karaƶz contacted me to notify me of the solution. Thanks Murat!)

 

The solution (from Stack Overflow):

A quick fix is to add the directory that contains libjpeg.so.8 to your /etc/ld.so.conf file, and then run ldconfig

 

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict