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

no matching function for call to 'replace(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, char, const value_type&)' #2

Open
powervan opened this issue Mar 7, 2022 · 2 comments · May be fixed by #3
Assignees

Comments

@powervan
Copy link

powervan commented Mar 7, 2022

I have the following error : change compiler CXX = $(BINPREF)g++ -std=gnu++11 $(M_ARCH) to
CXX = $(BINPREF)g++ -std=gnu++17 $(M_ARCH).

Message:
g++ -Iinclude -O2 -fPIC -std=c++17 -Wall -c -o obj/dic/variable_descriptor.o src/dic/variable_descriptor.cpp
src/dic/variable_descriptor.cpp: In static member function 'static std::optionalRedatam::VariableDescriptor::Declaration Redatam::VariableDescriptor::Declaration::fromDeclarationString(const string&)':
src/dic/variable_descriptor.cpp:22:69: error: no matching function for call to 'replace(std::__cxx11::basic_string::iterator, std::__cxx11::basic_string::iterator, char, const value_type&)'
std::replace(begin(p), end(p), '\', fs::path::preferred_separator);
^
In file included from C:/rtools40/mingw64/include/c++/8.3.0/algorithm:62,
from C:/rtools40/mingw64/include/c++/8.3.0/regex:38,
from src/dic/variable_descriptor.cpp:3:
C:/rtools40/mingw64/include/c++/8.3.0/bits/stl_algo.h:4362:5: note: candidate: 'template<class _FIter, class _Tp> void std::replace(_FIter, _FIter, const _Tp&, const _Tp&)'
replace(_ForwardIterator __first, _ForwardIterator __last,
^~~~~~~
C:/rtools40/mingw64/include/c++/8.3.0/bits/stl_algo.h:4362:5: note: template argument deduction/substitution failed:
src/dic/variable_descriptor.cpp:22:69: note: deduced conflicting types for parameter 'const _Tp' ('char' and 'std::experimental::filesystem::v1::__cxx11::path::value_type' {aka 'wchar_t'})
std::replace(begin(p), end(p), '\', fs::path::preferred_separator);
^
make: *** [Makefile:27: obj/dic/variable_descriptor.o] Error 1

@FranciscoDA
Copy link
Owner

FranciscoDA commented Mar 7, 2022

It seems that you're building the project in a windows system, which uses 16bit chars for file paths. This causes the build error you're experiencing.

Please checkout the non-posix branch from #3 , then try building again and report any new issues.

@FranciscoDA FranciscoDA linked a pull request Mar 8, 2022 that will close this issue
@FranciscoDA FranciscoDA self-assigned this Mar 9, 2022
@FranciscoDA
Copy link
Owner

@powervan Did you have any luck with the non-posix branch from #3 ?

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

Successfully merging a pull request may close this issue.

2 participants