Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing includes in jpegls_error.cpp when using libc++ (and not libstdc++) #62

Closed
SpaceIm opened this issue Mar 4, 2020 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@SpaceIm
Copy link

SpaceIm commented Mar 4, 2020

Clang <= 5 and AppleClang 9.3 fail to compile jpegls_error.cpp if using libc++ (and not libstdc++) because string (and system_error) are not included.

[ 44%] Building CXX object source_subfolder/CMakeFiles/charls.dir/src/jpegls_error.cpp.o
/home/conan/.conan/data/charls/2.1.0/bincrafters/testing/build/2b9f4a7d83ec1ec57c27b92740c5dea74386cdf8/source_subfolder/src/jpegls_error.cpp:19:12: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
    string message(int error_value) const override
           ^
/usr/include/c++/v1/iosfwd:193:33: note: template is declared here
    class _LIBCPP_TYPE_VIS_ONLY basic_string;
                                ^
/home/conan/.conan/data/charls/2.1.0/bincrafters/testing/build/2b9f4a7d83ec1ec57c27b92740c5dea74386cdf8/source_subfolder/src/jpegls_error.cpp:21:16: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'
        return charls_get_error_message(static_cast<jpegls_errc>(error_value));
               ^
/usr/include/c++/v1/iosfwd:193:33: note: template is declared here
    class _LIBCPP_TYPE_VIS_ONLY basic_string;
@vbaderks
Copy link
Contributor

vbaderks commented Mar 4, 2020

Thanks for report. Would a fix on "master" be enough?

Note: system_error should be included by means of jpegls_error.h

@SpaceIm
Copy link
Author

SpaceIm commented Mar 5, 2020

@vbaderks it doesn't matter for me. I only create package of releases for conan, so anyway I have to create a patch for 2.1.0 ;)

@vbaderks vbaderks added the bug label Mar 5, 2020
@vbaderks vbaderks added this to the 2.2.0 milestone Mar 5, 2020
@vbaderks vbaderks self-assigned this Mar 7, 2020
@vbaderks
Copy link
Contributor

vbaderks commented Mar 7, 2020

This has been resolved with commit 5a58c40.

It can be tested on Ubuntu 16.04 (WSL) with clang 4.0. The CI builds are using newer versions of clang and libc++ and don't have that problem because the system_error header already included the string header.

@vbaderks vbaderks closed this as completed Mar 7, 2020
@vbaderks vbaderks changed the title Missing includes in jpegls_error.cpp Missing includes in jpegls_error.cpp when using libc++ (and not libstdc++) Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants