프로그래밍/C++
[Error] error: no matching function for call to ‘std::basic_ifstream<char>::open(std::__cxx11::string&)’
Changun An
2022. 1. 19. 15:04
반응형
error: no matching function for call to ‘std::basic_ifstream<char>::open(std::__cxx11::string&)’
ifstream file.open(file_name);
c++11 컴파일 버전 문제로 file_name.c_str()로 사용하면 문제 일시적으로 해결 가능하며,
-std=c++11 를 cmake에 옵션으로 주어 해결 가능
ros cmakelist 참고
add_compile_options(-std=c++11)
반응형