What Operating System(s) are you seeing this problem on?
Linux (x86-64)
dlib version
a41c2e6
Python version
N/A
Compiler
GCC 15.2
Expected Behavior
no compilation failures
Current Behavior
compilation of dlib fails with the following error
image_processing/scan_image_pyramid_tools.h:85:1: error: need ‘typename’ before ‘std::__cxx11::list<std::pair<__decay(long unsigned int&), __decay(const dlib::rectangle)> >::iterator’ because ‘std::__cxx11::list<std::pair<__decay(long unsigned int&), __decay(const dlib::rectangle)> >’ is a dependent scope [-Wtemplate-body]
85 | list_type::iterator i = sorted_rects.begin();
Steps to Reproduce
checkout master branch at a41c2e6 and compile with GCC 15.2
Anything else?
I recently moved to Ubuntu 26.04 which uses GCC 15.2 as the default C++ compiler. This error appeared when compiling a fresh cmake config of a project that depends on dlib. I prefer to use the default GCC version for my Linux distro, so this is a problem.
Honestly, I think it may be a bug in GCC because the type it is complaining about is list_type::iterator where list_type is defined as typedef std::list<std::pair<unsigned long, rectangle> > list_type;. This is not a dependent type because it does not refer to any template parameters.
If I replace list_type::iterator with auto, it compiles fine. I can make a PR for this, but it seems like a dumb workaround.
What Operating System(s) are you seeing this problem on?
Linux (x86-64)
dlib version
a41c2e6
Python version
N/A
Compiler
GCC 15.2
Expected Behavior
no compilation failures
Current Behavior
compilation of dlib fails with the following error
Steps to Reproduce
checkout master branch at a41c2e6 and compile with GCC 15.2
Anything else?
I recently moved to Ubuntu 26.04 which uses GCC 15.2 as the default C++ compiler. This error appeared when compiling a fresh cmake config of a project that depends on dlib. I prefer to use the default GCC version for my Linux distro, so this is a problem.
Honestly, I think it may be a bug in GCC because the type it is complaining about is
list_type::iteratorwherelist_typeis defined astypedef std::list<std::pair<unsigned long, rectangle> > list_type;. This is not a dependent type because it does not refer to any template parameters.If I replace
list_type::iteratorwithauto, it compiles fine. I can make a PR for this, but it seems like a dumb workaround.