Open JoelSjogren opened 6 months ago
Another kind of error that I sometimes get and which is fixed by restarting is this.
In file included from input_line_11:1:
/home/joel/miniforge3/envs/cling/include/xcpp/xmime.hpp:49:30: error: no viable overloaded '='
bundle["text/plain"] = cling::printValue(&value);
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
input_line_95:2:2: note: in instantiation of function template specialization 'xcpp::mime_bundle_repr<long>' requested here
mime_bundle_repr(*((long*)0x7ffdab631e88));
^
/home/joel/miniforge3/envs/cling/include/nlohmann/json.hpp:1219:17: note: candidate function not viable: no known conversion from 'std::string' (aka 'basic_string<char>') to 'nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >' for 1st argument
basic_json& operator=(basic_json other) noexcept (
(That is to say, always something about nlohmann
's json library with this kind of repeatedly occurring error.)
In the case of what happened right now my cell looked like this to provoke this error:
cout.precision(1000000);
cout << 3.141592653589793238;
cout.precision(6); // default value
Another error that was solved by restarting:
In file included from input_line_5:1:
In file included from /home/joel/miniforge3/envs/cling/include/xeus/xinterpreter.hpp:13:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/functional:65:
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algo.h:2280:41: error: indirection requires pointer operand ('__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >' invalid)
return __i != __last && !(__val < *__i);
^~~~
input_line_16:2:2: note: in instantiation of function template specialization 'std::binary_search<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int>' requested here
binary_search(v.begin(), v.end(), 16);
^
In file included from input_line_5:1:
In file included from /home/joel/miniforge3/envs/cling/include/xeus/xinterpreter.hpp:13:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/functional:54:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/tuple:39:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/array:40:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algobase.h:66:
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_iterator_base_funcs.h:181:2: error: cannot increment value of type '__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >'
++__i;
^ ~~~
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_iterator_base_funcs.h:206:12: note: in instantiation of function template specialization 'std::__advance<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, long>' requested here
std::__advance(__i, __d, std::__iterator_category(__i));
^
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algobase.h:1321:9: note: in instantiation of function template specialization 'std::advance<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, long>' requested here
std::advance(__middle, __half);
^
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algo.h:2278:9: note: in instantiation of function template specialization 'std::__lower_bound<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int, __gnu_cxx::__ops::_Iter_less_val>' requested here
= std::__lower_bound(__first, __last, __val,
^
input_line_16:2:2: note: in instantiation of function template specialization 'std::binary_search<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int>' requested here
binary_search(v.begin(), v.end(), 16);
^
In file included from input_line_5:1:
In file included from /home/joel/miniforge3/envs/cling/include/xeus/xinterpreter.hpp:13:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/functional:54:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/tuple:39:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/array:40:
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algobase.h:1325:8: error: cannot increment value of type '__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >'
++__first;
^ ~~~~~~~
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algo.h:2278:9: note: in instantiation of function template specialization 'std::__lower_bound<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int, __gnu_cxx::__ops::_Iter_less_val>' requested here
= std::__lower_bound(__first, __last, __val,
^
input_line_16:2:2: note: in instantiation of function template specialization 'std::binary_search<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int>' requested here
binary_search(v.begin(), v.end(), 16);
^
In file included from input_line_5:1:
In file included from /home/joel/miniforge3/envs/cling/include/xeus/xinterpreter.hpp:13:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/functional:54:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/tuple:39:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/array:40:
In file included from /home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algobase.h:71:
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/predefined_ops.h:67:16: error: indirection requires pointer operand ('__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >' invalid)
{ return *__it < __val; }
^~~~~
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algobase.h:1322:8: note: in instantiation of function template specialization '__gnu_cxx::__ops::_Iter_less_val::operator()<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, const int>' requested here
if (__comp(__middle, __val))
^
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algo.h:2278:9: note: in instantiation of function template specialization 'std::__lower_bound<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int, __gnu_cxx::__ops::_Iter_less_val>' requested here
= std::__lower_bound(__first, __last, __val,
^
input_line_16:2:2: note: in instantiation of function template specialization 'std::binary_search<__gnu_cxx::__normal_iterator<int *, std::vector<int, std::allocator<int> > >, int>' requested here
binary_search(v.begin(), v.end(), 16);
^
Interpreter Error:
Here I was running these cells (error on second cell):
vector<int> v = range(10, 20);
cout << v;
binary_search(v.begin(), v.end(), 16);
Similar error fixed after kernel restart:
input_line_61:5:21: error: no viable conversion from 'std::__cxx11::list<int, std::allocator<int> >::const_iterator' (aka '_List_const_iterator<int>') to 'list<int>::iterator' (aka '_List_iterator<int>')
list<int>::iterator it = li2.begin();
^ ~~~~~~~~~~~
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_list.h:185:12: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'std::__cxx11::list<int, std::allocator<int> >::const_iterator' (aka '_List_const_iterator<int>') to 'const std::_List_iterator<int> &' for 1st argument
struct _List_iterator
^
/home/joel/miniforge3/envs/cling/bin/../lib/gcc/../../x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_list.h:185:12: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'std::__cxx11::list<int, std::allocator<int> >::const_iterator' (aka '_List_const_iterator<int>') to 'std::_List_iterator<int> &&' for 1st argument
Interpreter Error:
#include <vector>
#include <list>
using namespace std;
vector<int> vi = { 45, 2, 9, 0, -2, 155 };
list<int> li2 = { 0, 1, 2, 3, 4, 5, 6 };
list<int>::iterator it = li2.begin();
for (int i = 0; i < 3; i++) it++;
copy(vi.begin(), vi.end(), inserter(li2, it));
Will stop posting examples now.
No errors from my side for first two. Third snippet as C++ program is not compiling with C++20.
Hello, I frequently need to restart the kernel in order to avoid this sort of error message when evaluating a cell:
I have noticed that
std::__not_
is always part of this message but I don't know what the message means in whole.In this case I was playing around with code like the following but it is a really general issue.