×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Use of overloaded operator "[]" is ambiguous

  • Posts: 123
  • Thank you received: 13
Having trouble runing indi on RaspberryPi I got 20 or so " use of overloaded operator "[]" is ambiguous"

I found it is GCC issue, but going to Clang did not help.
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/10/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 10.2.1-6+rpi1' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Raspbian 10.2.1-6+rpi1)
Raspbian clang version 11.0.1-2+rpi1
Target: armv6k-unknown-linux-gnueabihf
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/10
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/7
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/8
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/10
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/7
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/7.5.0
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/8
Selected GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/10
Candidate multilib: .;@m32
Selected multilib: .;@m32
1 year 4 months ago #88110
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 123
  • Thank you received: 13
Forgot to add this:
/home/astroberry/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:239: error: use of overloaded operator '[]' is ambiguous (with operand types 'INDI::PropertySwitch' and 'INDI::CCD::(anonymous enum at /usr/include/libindi/indiccd.h:707:9)')
/home/astroberry/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:239:27: error: use of overloaded operator '[]' is ambiguous (with operand types 'INDI::PropertySwitch' and 'INDI::CCD::(anonymous enum at /usr/include/libindi/indiccd.h:707:9)')
        if (EncodeFormatSP[FORMAT_FITS].getState() == ISS_ON)
            ~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/libindi/indipropertybasic.h:113:24: note: candidate function
        WidgetView<T> &operator[](size_t index) const;
                       ^
/home/astroberry/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:239:27: note: built-in candidate operator[](class INDI::Property *, int)
        if (EncodeFormatSP[FORMAT_FITS].getState() == ISS_ON)
                          ^
/home/astroberry/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:239:27: note: built-in candidate operator[](const class INDI::Property *, int)
/home/astroberry/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:239:27: note: built-in candidate operator[](volatile class INDI::Property *, int)
/home/astroberry/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:239:27: note: built-in candidate operator[](const volatile class INDI::Property *, int)
1 year 4 months ago #88112

Please Log in or Create an account to join the conversation.

I just recompiled this driver against INDI GIT and didn't get this error. I'm also building it against libcamera and libcamera-apps GIT.
1 year 4 months ago #88115

Please Log in or Create an account to join the conversation.

  • Posts: 123
  • Thank you received: 13
Ok, I now tried to build Indi_Libcamera as well, and it is failing with same error, while it was successful before. That means it is something wrong with my environment.

I did kernel update, and I did install whole QT5 suite and built and installed indi via terminal, it seems that something is messed up there, but I will try to revert to previous versions, if it does not help then I need to do clean reinstall. I think you can close this one as It is definitely environment issue I just need to find out what exactly.
1 year 4 months ago #88117

Please Log in or Create an account to join the conversation.

  • Posts: 123
  • Thank you received: 13
DISREGARD ALL BELLOW! I forgot to press enter on sudo make install for raw indi project

I have installed complete clean new clean OS install
And when I compile i get this error:

In file included from /home/astroberry/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:21:
/home/astroberry/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.h:23:10: fatal error: indipropertyswitch.h: No such file or directory
   23 | #include "indipropertyswitch.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/indi_libcamera_ccd.dir/build.make:82: CMakeFiles/indi_libcamera_ccd.dir/indi_libcamera.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/indi_libcamera_ccd.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
</code>
 
This is complete history,  I have removed typoes 
 
<code>
  1  sudo raspi-config
    2  ls
                               3  dudo reboot
    4  sudo reboot
    5  sudo raspi-config
    6  sudo apt-get install -y   git   cdbs   dkms   cmake   fxload   libev-dev   libgps-dev   libgsl-dev   libraw-dev   libusb-dev   zlib1g-dev   libftdi-dev   libgsl0-dev   libjpeg-dev   libkrb5-dev   libnova-dev   libtiff-dev   libfftw3-dev   librtlsdr-dev   libcfitsio-dev   libgphoto2-dev   build-essential   libusb-1.0-0-dev   libdc1394-22-dev   libboost-regex-dev   libcurl4-gnutls-dev   libtheora-dev
    7  mkdir -p ~/Projects
    8  cd ~/Projects
    9  git clone https://github.com/indilib/indi.git
   10  mkdir -p ~/Projects/build/indi-core
   11  cd ~/Projects/build/indi-core
   12  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi
   13  make -j4
                   14  cd..[/sup]
   15  cd ..
   16  sudo apt-get -y install libnova-dev libcfitsio-dev libusb-1.0-0-dev zlib1g-dev libgsl-dev build-essential cmake git libjpeg-dev libcurl4-gnutls-dev libtiff-dev libfftw3-dev libftdi-dev libgps-dev libraw-dev libdc1394-22-dev libgphoto2-dev libboost-dev libboost-regex-dev librtlsdr-dev liblimesuite-dev libftdi1-dev libavcodec-dev libavdevice-dev
   17  sudo apt-get -y install libindi-dev
   18  git clone https://github.com/indilib/indi-3rdparty
                   19  mkdir -p ~/Projects/build/indi-eqmod
   20  cd ~/Projects/build/indi-eqmod
   21  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi-3rdparty/indi-eqmod
   22  make -j4
   23  sudo make install[/sup]
   24  cd ..
                   25  cd .[/sup]
   26  cd ..
   27  sudo apt install libcamera-apps
   28  sudo nano /boot/config.txt 
   29  sudo reboot 
   30  libcamera-hello --list-cameras
   31  mkdir -p ~/Projects/build/indi-libcamera
   32  cd ~/Projects/build/indi-libcamera
   33  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi-3rdparty/indi-libcamera
   34  make -j4
   35  sudo make install
   36  cmake -DCMAKE_INSTALL_PREFIX=/usr ..
   37  make
   38  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi-3rdparty/indi-libcamera/
   39  sudo apt install libcamera-dev
   40  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi-3rdparty/indi-libcamera/
   41  sudo apt install boost
   42  sudo apt install Boost
   43  sudo apt install Boost-dev
   44  sudo apt install build-essential libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev
   45  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi-3rdparty/indi-libcamera/
   46  make -j4
   47  sudo apt-get -y install libindi-dev
   48  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi-3rdparty/indi-libcamera/
   49  make -j4
Last edit: 1 year 3 months ago by Outta.
1 year 4 months ago #88125

Please Log in or Create an account to join the conversation.

  • Posts: 123
  • Thank you received: 13
Just final comment, I made it work on my old environemnt as well.

Reason why it was not working was discrepancy in usr/include/libindi. in new environment it was larger by 100kb and it contained "abstractbaseclient.h" among other things that "older" version was missing.

Simply copping /usr/include/libindi didindeed fix the problem with "Use of overloaded operator "[]" is ambiguous". I am not sure why it was not updating properly by default.
Last edit: 1 year 4 months ago by Outta.
1 year 4 months ago #88164

Please Log in or Create an account to join the conversation.

  • Posts: 27
  • Thank you received: 4
I need indi-server on a Raspberry Pi Zero to provide a remote server for the HQ camera. I try to compile the latest INDI (release 1.9.9) from GitHub and get many of such warnings:
[  5%] Building CXX object libs/indidevice/CMakeFiles/indidevice.dir/property/indipropertybasic.cpp.o
In file included from /usr/include/c++/10/vector:72,
                 from /home/cam/Projects/indi/libs/indidevice/property/indiproperties.h:22,
                 from /home/cam/Projects/indi/libs/indidevice/basedevice.h:23,
                 from /home/cam/Projects/indi/libs/indidevice/property/indiproperty_p.h:25,
                 from /home/cam/Projects/indi/libs/indidevice/property/indipropertybasic_p.h:21,
                 from /home/cam/Projects/indi/libs/indidevice/property/indipropertybasic.cpp:20:
/usr/include/c++/10/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {INDI::WidgetView<_INumber>}; _Tp = INDI::WidgetView<_INumber>; _Alloc = std::allocator<INDI::WidgetView<_INumber> >]’:
/usr/include/c++/10/bits/vector.tcc:121:21: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<INDI::WidgetView<_INumber>*, std::vector<INDI::WidgetView<_INumber>, std::allocator<INDI::WidgetView<_INumber> > > >’ changed in GCC 7.1
  121 |    _M_realloc_insert(end(), std::forward<_Args>(__args)...);
      |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In addition I see many of these:
In file included from /home/cam/Projects/indi/libs/indidevice/property/indipropertytext.h:21,
                 from /home/cam/Projects/indi/libs/indidevice/./basedevice.h:30,
                 from /home/cam/Projects/indi/libs/indidevice/./watchdeviceproperty.h:21,
                 from /home/cam/Projects/indi/libs/indiabstractclient/abstractbaseclient_p.h:24,
                 from /home/cam/Projects/indi/libs/indiabstractclient/abstractbaseclient.cpp:23:
/home/cam/Projects/indi/libs/indidevice/property/indipropertybasic.h:116:24: note: candidate 1: ‘INDI::WidgetView<T>& INDI::PropertyBasic<T>::operator[](size_t) const [with T = _ISwitch; size_t = unsigned int]116 |         WidgetView<T> &operator[](size_t index) const;
      |                        ^~~~~~~~
/home/cam/Projects/indi/libs/indiabstractclient/abstractbaseclient.cpp:275:29: note: candidate 2: ‘operator[](const INDI::Property*, int)(built-in)
  275 |         if (drv_connection[0].getState() == ISS_ON)
      |                             ^
/home/cam/Projects/indi/libs/indiabstractclient/abstractbaseclient.cpp:275:29: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
In file included from /home/cam/Projects/indi/libs/indidevice/property/indipropertytext.h:21,
                 from /home/cam/Projects/indi/libs/indidevice/./basedevice.h:30,
                 from /home/cam/Projects/indi/libs/indidevice/./watchdeviceproperty.h:21,
                 from /home/cam/Projects/indi/libs/indiabstractclient/abstractbaseclient_p.h:24,
                 from /home/cam/Projects/indi/libs/indiabstractclient/abstractbaseclient.cpp:23:
/home/cam/Projects/indi/libs/indidevice/property/indipropertybasic.h:116:24: note: candidate 1: ‘INDI::WidgetView<T>& INDI::PropertyBasic<T>::operator[](size_t) const [with T = _ISwitch; size_t = unsigned int]116 |         WidgetView<T> &operator[](size_t index) const;
      |                        ^~~~~~~~
/home/cam/Projects/indi/libs/indiabstractclient/abstractbaseclient.cpp:275:29: note: candidate 2: ‘operator[](INDI::PropertyView<_INumber>*, int)(built-in)
  275 |         if (drv_connection[0].getState() == ISS_ON)
      |                             ^
/home/cam/Projects/indi/libs/indiabstractclient/abstractbaseclient.cpp:275:29: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:

Likely both warnings have same reason. Is that normal?

When reading the discussion above it seems to me that OUTTA's issues came from a version mix. But my environment is fresh and did not contain INDI before.

I build on a Raspberry Pi Zero with a fresh installed and updated Raspbian 11 (bullseye).
The complete logs of cmake and make are attached.
1 year 3 months ago #88802
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 17
Use of overloaded operator "[]" is ambiguous
Fixed: github.com/indilib/indi/pull/1775
The following user(s) said Thank You: Outta, Ronald Schreiber
1 year 3 months ago #88822

Please Log in or Create an account to join the conversation.

  • Posts: 27
  • Thank you received: 4
Pawel, many thanks. The `operator "[]" is ambiguous` warnings are gone with the new version on GitHub. What remains are the `parameter passing for argument of type ... changed in GCC 7.1`. But this is maybe another topic.
1 year 3 months ago #88853
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 472
  • Thank you received: 165
The parameter passing warning is harmless (and you can't do anything about it except disable the warning with -Wno-psabi) if you aren't mixing libraries compiled with pre-GCC 7.1 with GCC 7.1+ which is very rarely the case when the same distro compiler is used for everything (and GCC 7.1 was released already in May 2017). GCC 7.1 documentation states: "On ARM targets (arm*-*-*), a bug introduced in GCC 5 that affects conformance to the procedure call standard (AAPCS) has been fixed. The bug affects some C++ code where class objects are passed by value to functions and could result in incorrect or inconsistent code being generated. This is an ABI change. If the option -Wpsabi is enabled (on by default) the compiler will emit a diagnostic note for code that might be affected."
The following user(s) said Thank You: Ronald Schreiber
1 year 3 months ago #88863

Please Log in or Create an account to join the conversation.

Time to create page: 1.421 seconds