Can't compile file: program.cpp: In function 'int computeA(int, const std::vector<int>&,…
- User
Can't compile file: program.cpp: In function 'int compute_A(int, const std::vector&, const std::vector&)': program.cpp:12:66: warning: conversion from '__gnu_cxx::__normal_iterator<const int*, std::vector >::difference_type' {aka 'long long int'} to 'int' may change value [-Wconversion] 12 | int cnt_a = upper_bound(sorted_a.begin(), sorted_a.end(), x) - sorted_a.begin(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ program.cpp:13:66: warning: conversion from '__gnu_cxx::__normal_iterator<const int*, std::vector >::difference_type' {aka 'long long int'} to 'int' may change value [-Wconversion] 13 | int cnt_b = lower_bound(sorted_b.begin(), sorted_b.end(), x) - sorted_b.begin(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ program.cpp: In function 'int compute_B(int, const std::vector&, const std::vector&)': program.cpp:18:66: warning: conversion from '__gnu_cxx::__normal_iterator<const int*, std::vector >::difference_type' {aka 'long long int'} to 'int' may change value [-Wconversion] 18 | int cnt_c = upper_bound(sorted_c.begin(), sorted_c.end(), y) - sorted_c.begin(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ program.cpp:19:66: warning: conversion from '__gnu_cxx::__normal_iterator<const int*, std::vector >::difference_type' {aka 'long long int'} to 'int' may change value [-Wconversion] 19 | int cnt_d = lower_bound(sorted_d.begin(), sorted_d.end(), y) - sorted_d.begin(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ In file included from C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/string:43, from C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/bitset:52, from C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/x86_64-w64-mingw32/bits/stdc++.h:52, from program.cpp:4: C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/bits/allocator.h: In destructor 'constexpr std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int> > >::_Vector_impl::~_Vector_impl()': C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/bits/allocator.h:184:7: error: inlining failed in call to 'always_inline' 'constexpr std::allocator< >::~allocator() noexcept [with _Tp = std::pair<int, int>]': target specific option mismatch 184 | ~allocator() _GLIBCXX_NOTHROW { } | ^ In file included from C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/vector:66, from C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/functional:64, from C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/x86_64-w64-mingw32/bits/stdc++.h:53: C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/bits/stl_vector.h:133:14: note: called from here 133 | struct _Vector_impl
- Assistant
- User
на русском
- Assistant
- User
Can't compile file: In file included from C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/string:43, from C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/bits/locale_classes.h:40, from C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/bits/ios_base.h:41, from C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/ios:44, from C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/ostream:40, from C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/iostream:41, from program.cpp:4: C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/bits/allocator.h: In destructor 'constexpr std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int> > >::_Vector_impl::~_Vector_impl()': C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/bits/allocator.h:184:7: error: inlining failed in call to 'always_inline' 'constexpr std::allocator< >::~allocator() noexcept [with _Tp = std::pair<int, int>]': target specific option mismatch 184 | ~allocator() _GLIBCXX_NOTHROW { } | ^ In file included from C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/vector:66, from program.cpp:5: C:/Programs/gcc13-64-winlibs/include/c++/13.2.0/bits/stl_vector.h:133:14: note: called from here 133 | struct _Vector_impl
- Assistant
Ошибка, которую вы получаете, связана с проблемой инлайн-компиляции деструктора для аллокатора в стандартной библиотеке C++. Обычно такое сообщение об ошибке указывает на несоответствие настройки компилятора или версии режима компиляции. Вот несколько шагов, которые вы можете предпринять для устранения этой проблемы:
- User
- Assistant