(C++) 'jpeg\read\image' was not declared in this scope
January 10, 2018 · View on GitHub
Full error message
/MyFolder/main.cpp:8: error: 'jpeg_read_image' was not declared in this scope
Cause
IDE: Qt Creator 1.3.1
Project type: Qt4 Console Application
Selected required modules: QtCore
Boost version: 1.42.0
The following code caused the error:
#include <boost/gil/gil_all.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 = MyProjectName peglib += console peglib -= app_bundle INCLUDEPATH += ../../../boost_1_42_0 TEMPLATE = app SOURCES += main.cpp
Solution
Unknown. Feel encouraged to contact me if you know the solution.
Unsuccessfull trials
#include the needed header file directly
#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); }
For me, this resulted in the compile error jpeglib.h: No such file or directory.