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

Failed to compile with MSVC 17.8.3 #566

Closed
UMU618 opened this issue Dec 9, 2023 · 5 comments
Closed

Failed to compile with MSVC 17.8.3 #566

UMU618 opened this issue Dec 9, 2023 · 5 comments

Comments

@UMU618
Copy link
Contributor

UMU618 commented Dec 9, 2023

#include <boost/filesystem.hpp>

#include <fast_io.h>

will product error:

Build started at 16:18...
1>------ Build started: Project: fast_io_hello, Configuration: Release x64 ------
1>fast_io_hello.cpp
1>D:\github\microsoft\vcpkg\installed\x64-windows\include\fast_io_unit\string_impl\msvc_stl.h(20,8): error C2977: 'std::_String_iter_types': too many template arguments
1>(compiling source file 'fast_io_hello.cpp')
1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\xstring(2193,1):
1>see declaration of 'std::_String_iter_types'
1>D:\github\microsoft\vcpkg\installed\x64-windows\include\fast_io_unit\string_impl\msvc_stl.h(20,8):
1>the template instantiation context (the oldest one first) is
1>	D:\github\microsoft\vcpkg\installed\x64-windows\include\fast_io_unit\string_impl\msvc_stl.h(24,2):
1>	see reference to class template instantiation 'fast_io::details::string_hack::model<_Elem,_Traits,_Alloc>' being compiled
1>D:\github\microsoft\vcpkg\installed\x64-windows\include\fast_io_unit\string_impl\msvc_stl.h(20,8): error C3203: '_String_iter_types': unspecialized class template can't be used as a template argument for template parameter '_Ty2', expected a real type
1>(compiling source file 'fast_io_hello.cpp')
1>Done building project "fast_io_hello.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 16:18 and took 01.258 seconds ==========

Change the order of inclusion, will work:

#include <fast_io.h>

#include <boost/filesystem.hpp>
@UMU618
Copy link
Contributor Author

UMU618 commented Dec 9, 2023

Also conflicts with #include <filesystem>

@UMU618
Copy link
Contributor Author

UMU618 commented Dec 9, 2023

It seems MS has change the definition of _String_iter_types, since MSVC 17.8.3

From:

template <class _Value_type, class _Size_type, class _Difference_type, class _Pointer, class _Const_pointer,
    class _Reference, class _Const_reference>
struct _String_iter_types {
    using value_type      = _Value_type;
    using size_type       = _Size_type;
    using difference_type = _Difference_type;
    using pointer         = _Pointer;
    using const_pointer   = _Const_pointer;
};

To:

template <class _Value_type, class _Size_type, class _Difference_type, class _Pointer, class _Const_pointer>
struct _String_iter_types {
    using value_type      = _Value_type;
    using size_type       = _Size_type;
    using difference_type = _Difference_type;
    using pointer         = _Pointer;
    using const_pointer   = _Const_pointer;
};

@UMU618
Copy link
Contributor Author

UMU618 commented Dec 9, 2023

about 17.8.3:

_MSC_VER = 1938
_MSVC_STL_UPDATE = 202308
_MSVC_STL_VERSION = 143

@UMU618 UMU618 changed the title Conflicts with Boost.FileSystem Failed to compile with MSVC 17.8.3 Dec 9, 2023
@trcrsired
Copy link
Member

vcpkg上的版本太老导致的。直接克隆include头文件就行了

@UMU618
Copy link
Contributor Author

UMU618 commented Dec 9, 2023

Already fixed there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants