You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compile it with MSVC (using Visual Studio, CMake, etc.)
Expected Behavior
The code is compiled successfully.
Actual Behavior
The compiler complains error C2039: 'vector': is not a member of 'std'.
System Info
Windows 10 Pro x64
C++11
mio @ 3f86a95
cmake 3.19.2 (CLion bundled)
cl 19.28.29914 for x64
Possible Solution
For users: Add #include <vector> before #include <mio/mmap.hpp>.
Notes
The complete compilation output, using CMake + Ninja + MSVC in CLion.
====================[ Build | Mio | RelWithDebInfo ]============================
"C:\Program Files\JetBrains\CLion\2021.1\bin\cmake\win\bin\cmake.exe" --build <Path Redacted>\build\release --target Mio
[1/2] Building CXX object CMakeFiles\Mio.dir\example\Mio.cpp.obj
FAILED: CMakeFiles/Mio.dir/example/Mio.cpp.obj
C:\PROGRA~2\MICROS~2\2019\BUILDT~1\VC\Tools\MSVC\1428~1.299\bin\Hostx64\x64\cl.exe /nologo /TP -DNOMINMAX -DSOLUTION_DIR=\"<Path Redacted>\" -D_CRT_SECURE_NO_WARNINGS -I..\..\src -I..\..\dep\AUROC -I..\..\dep\mio\include -IC:\ProgramData\vcpkg\installed\x64-windows\include -IC:\ProgramData\Miniconda3\Library\include /DWIN32 /D_WINDOWS /GR /EHsc /Zi /O2 /Ob1 /DNDEBUG -MD /arch:AVX2 /fp:fast /GL /Gw /showIncludes /FoCMakeFiles\Mio.dir\example\Mio.cpp.obj /FdCMakeFiles\Mio.dir\ /FS -c ..\..\example\Mio.cpp
<Path Redacted>\dep\mio\include\mio\detail/mmap.ipp(60): error C2039: 'vector': is not a member of 'std'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include\algorithm(40): note: see declaration of 'std'
<Path Redacted>\dep\mio\include\mio\detail/mmap.ipp(60): error C2065: 'vector': undeclared identifier
<Path Redacted>\dep\mio\include\mio\detail/mmap.ipp(60): error C2062: type 'wchar_t' unexpected
<Path Redacted>\dep\mio\include\mio\detail/mmap.ipp(61): error C3536: 'buf': cannot be used before it is initialized
<Path Redacted>\dep\mio\include\mio\detail/mmap.ipp(61): error C2660: 'MultiByteToWideChar': function does not take 5 arguments
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\stringapiset.h(126): note: see declaration of 'MultiByteToWideChar'
<Path Redacted>\dep\mio\include\mio\detail/mmap.ipp(61): error C2789: 'wide_char_count': an object of const-qualified type must be initialized
<Path Redacted>\dep\mio\include\mio\detail/mmap.ipp(61): note: see declaration of 'wide_char_count'
<Path Redacted>\dep\mio\include\mio\detail/mmap.ipp(62): error C3536: 'wide_char_count': cannot be used before it is initialized
<Path Redacted>\dep\mio\include\mio\detail/mmap.ipp(62): error C2440: '<function-style-cast>': cannot convert from 'int' to 'std::wstring'
<Path Redacted>\dep\mio\include\mio\detail/mmap.ipp(62): note: No constructor could take the source type, or constructor overload resolution was ambiguous
ninja: build stopped: subcommand failed.
The text was updated successfully, but these errors were encountered:
Description
When compiled with MSVC (or clang-cl on Windows), the compiler complains
vector
is not found.Reproduction
Expected Behavior
The code is compiled successfully.
Actual Behavior
The compiler complains
error C2039: 'vector': is not a member of 'std'
.System Info
Windows 10 Pro x64
C++11
mio @ 3f86a95
cmake 3.19.2 (CLion bundled)
cl 19.28.29914 for x64
Possible Solution
For users: Add
#include <vector>
before#include <mio/mmap.hpp>
.Notes
The complete compilation output, using CMake + Ninja + MSVC in CLion.
The text was updated successfully, but these errors were encountered: