[Windows 11] Encountering errors related to features in C++11. Changed makefile to minimum C++14 from C++11
xXWarMachineRoXx opened this issue · 2 comments
xXWarMachineRoXx commented
Error Log
In file included from src/models/match.cpp:1:
In file included from src/models\match.h:4:
In file included from src/models\model.h:4:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\valarray:11:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\xmemory:15:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\xutility:546:15: error: deduced
return types are a C++14 extension
546 | constexpr decltype(auto) operator()(_Args&&... _Vals) noexcept(
| ^
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\xutility:559:22: error: 'auto' return
without trailing return type; deduced return types are a C++14 extension
559 | _NODISCARD constexpr auto _Pass_fn(_Fn& _Func) noexcept {
| ^
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\xutility:1162:16: error: constexpr
function's return type 'void' is not a literal type
1162 | constexpr void _Adl_verify_range(const _Iter& _First, const _Sentinel& _Last) {
| ^
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\xutility:1184:22: error: deduced
return types are a C++14 extension
1184 | _NODISCARD constexpr decltype(auto) _Get_unwrapped(_Iter&& _It) noexcept(
| ^
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\xutility:1212:22: error: deduced
return types are a C++14 extension
1212 | _NODISCARD constexpr decltype(auto) _Get_unwrapped_unverified(_Iter&& _It) {
Solution
- change makefile to support C++ 17 instead of 14.
CC = clang++
LFLAGS = -std=c++14 -Wall # Updated to C++14
all: LFLAGS += -Ofast -march=native
all: cmix enwik9-preproc
debug: LFLAGS += -ggdb
debug: cmix enwik9-preproc
cmix: src/coder/decoder.cpp src/coder/decoder.h src/coder/encoder.cpp src/coder/encoder.h src/context-manager.cpp src/context-manager.h src/contexts/bit-context.cpp src/contexts/bit-context.h src/contexts/bracket-context.cpp src/contexts/bracket-context.h src/contexts/combined-context.cpp src/contexts/combined-context.h src/contexts/context-hash.cpp src/contexts/context-hash.h src/contexts/context.h src/contexts/indirect-hash.cpp src/contexts/indirect-hash.h src/contexts/interval-hash.cpp src/contexts/interval-hash.h src/contexts/interval.cpp src/contexts/interval.h src/contexts/sparse.cpp src/contexts/sparse.h src/mixer/byte-mixer.cpp src/mixer/byte-mixer.h src/mixer/lstm-layer.cpp src/mixer/lstm-layer.h src/mixer/lstm.cpp src/mixer/lstm.h src/mixer/mixer-input.cpp src/mixer/mixer-input.h src/mixer/mixer.cpp src/mixer/mixer.h src/mixer/sigmoid.cpp src/mixer/sigmoid.h src/mixer/sse.cpp src/mixer/sse.h src/models/bracket.cpp src/models/bracket.h src/models/byte-model.cpp src/models/byte-model.h src/models/direct-hash.cpp src/models/direct-hash.h src/models/direct.cpp src/models/direct.h src/models/indirect.cpp src/models/indirect.h src/models/fxcmv1.cpp src/models/fxcmv1.h src/models/match.cpp src/models/match.h src/models/model.h src/models/paq8.cpp src/models/paq8.h src/models/ppmd.cpp src/models/ppmd.h src/predictor.cpp src/predictor.h src/preprocess/dictionary.cpp src/preprocess/dictionary.h src/preprocess/preprocessor.cpp src/preprocess/preprocessor.h src/runner.cpp src/states/nonstationary.cpp src/states/nonstationary.h src/states/run-map.cpp src/states/run-map.h src/states/state.h
$(CC) $(LFLAGS) src/coder/decoder.cpp src/coder/encoder.cpp src/context-manager.cpp src/contexts/bit-context.cpp src/contexts/bracket-context.cpp src/contexts/combined-context.cpp src/contexts/context-hash.cpp src/contexts/indirect-hash.cpp src/contexts/interval-hash.cpp src/contexts/interval.cpp src/contexts/sparse.cpp src/mixer/byte-mixer.cpp src/mixer/lstm-layer.cpp src/mixer/lstm.cpp src/mixer/mixer-input.cpp src/mixer/mixer.cpp src/mixer/sigmoid.cpp src/mixer/sse.cpp src/models/bracket.cpp src/models/byte-model.cpp src/models/direct-hash.cpp src/models/direct.cpp src/models/indirect.cpp src/models/fxcmv1.cpp src/models/match.cpp src/models/paq8.cpp src/models/ppmd.cpp src/predictor.cpp src/preprocess/dictionary.cpp src/preprocess/preprocessor.cpp src/runner.cpp src/states/nonstationary.cpp src/states/run-map.cpp -o cmix
enwik9-preproc: src/enwik9-preproc/article_reorder.h src/enwik9-preproc/main.cpp src/enwik9-preproc/misc.h src/enwik9-preproc/phda9_preprocess.h
$(CC) $(LFLAGS) src/enwik9-preproc/main.cpp -o enwik9-preproc
clean:
rm -f cmix enwik9-preproc
corrected file attachedmakefile.txt
byronknoll commented
Thanks, fixed.
xXWarMachineRoXx commented
dang , I could have submitted a PR. I dunno would love if I can make a PR to a public repo. 😸