vision.cpp:5:18: error: 'a' was not declared in this scope
5 | int dist(a, b, w){
| ^
vision.cpp:5:21: error: 'b' was not declared in this scope
5 | int dist(a, b, w){
| ^
vision.cpp:5:24: error: 'w' was not declared in this scope
5 | int dist(a, b, w){
| ^
vision.cpp:5:25: error: expression list treated as compound expression in initializer [-fpermissive]
5 | int dist(a, b, w){
| ^
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:17:17: error: 'lastindex' was not declared in this scope
17 | lastindex = H*W-2;
| ^~~~~~~~~
vision.cpp:27:47: error: 'dist' cannot be used as a function
27 | if(j>i && dist(i,j)==K){
| ~~~~^~~~~
vision.cpp:32:53: error: no match for 'operator=' (operand types are 'std::vector<int>' and '<brace-enclosed initializer list>')
32 | ns = {lastindex, lastindex+1};
| ^
In file included from /usr/include/c++/11/vector:72,
from vision.h:5,
from vision.cpp:1:
/usr/include/c++/11/bits/vector.tcc:198:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
198 | vector<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/bits/vector.tcc:199:42: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<int>&'
199 | operator=(const vector<_Tp, _Alloc>& __x)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/11/vector:67,
from vision.h:5,
from vision.cpp:1:
/usr/include/c++/11/bits/stl_vector.h:709:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
709 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
| ^~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:709:26: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<int>&&'
709 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
| ~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_vector.h:730:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
730 | operator=(initializer_list<value_type> __l)
| ^~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:730:46: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::initializer_list<int>'
730 | operator=(initializer_list<value_type> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~