Modersi / TelegramBotAPI

Telegram Bot API on C++ and Qt
MIT License
33 stars 17 forks source link

Build Issue '_is_iterator_v' is not a member of 'std' #13

Open silversheart opened 5 months ago

silversheart commented 5 months ago

Hi! I need so much your library, but can't build it in Qt 6.6.3. In 'QJsonArrayInserter.h', row 33, where we have

/** @brief Creates a new QJsonArray with the contents of the range [first, last) */
        template<typename Iterator>
            requires std::_Is_iterator_v<Iterator>
        static QJsonArray make(Iterator begin, Iterator end);

compiler throws a build issue '_is_iterator_v' is not a member of 'std'. I tried to find this template '_Is_iterator_v' in cppreference.com and cplusplus.com but don't give any results! Also I tried recent gcc compiler (14.0.1) with the same result. Can you advise how to compile the library in Qt 6.6.3 (and for Ubuntu 22.04 LTS in particular)? Best regards, Oleksiy.

Modersi commented 5 months ago

Привет, сегодня вечером приду домой посмотрю в чем проблема :) Спасибо что сообщил!

Можешь пожалуйста прислать мне ту часть своего кода в котором выбрасывается это исключение?

Спасибо большое

чт, 28 мар. 2024 г., 10:46 Олексій @.***>:

Hi! I need so much your library, but can't build it in Qt 6.6.3. In 'QJsonArrayInserter.h', row 33, where we have

/* @brief Creates a new QJsonArray with the contents of the range [first, last) / template requires std::_Is_iterator_v static QJsonArray make(Iterator begin, Iterator end);

compiler throws a build issue '_is_iterator_v' is not a member of 'std'. I tried to find this template '_Is_iterator_v' in cppreference.com and cplusplus.com but don't give any results! Also I tried recent gcc compiler (14.0.1) with the same result. Can you advise how to compile the library in Qt 6.6.3 (and for Ubuntu 22.04 LTS in particular)? Best regards, Oleksiy.

— Reply to this email directly, view it on GitHub https://github.com/Modersi/TelegramBotAPI/issues/13, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS5TSDYLOM6KX5G53DT4TZ3Y2PKE5AVCNFSM6AAAAABFMOMYAGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTENZXHE2DOMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

silversheart commented 5 months ago

Подивився ваш профіль в Лінкедінє і вирішив переписати повідомлення рідною мовою. Тут ще й коду то немає. Перед тим як підключити бібліотеку до проєкту, її ж треба зібрати з джерел! Я клоню проєкт, відкриваю його в Qt намагаюсь компілювати і отримую власне сабж. До коду справа ще не дійшла. Спочатку думав, що компілятор не підтримує версію С++ - зібрав GCC останньої версії - нічого не змінилось. Думаю знайду в документації С++ що це за темплейт, може одруківка, може зможу використати щось рідне з Qt - так і в документації немає такого _Is_iterator_v. Ось і прошу поради, що треба зробити щоб бібліотека зкомпілювалась.

Modersi commented 5 months ago

Ой, не заметил что ты написал что ошибка выскакивает при сборке

Вечером приду домой пошаманю, проапдейчу репозиторий :)

чт, 28 мар. 2024 г., 14:42 Олексій @.***>:

Тут как бы и кода нет. Прежде чем подключить библиотеку к своему проекту, ее ж нужно собрать. Я клоню проект, открываю его в Qt пробую компилировать и получаю сабж собственно. До кода дело еще не дошло )

— Reply to this email directly, view it on GitHub https://github.com/Modersi/TelegramBotAPI/issues/13#issuecomment-2025219894, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS5TSD26PLM2B5GAFGRFYRTY2QF3ZAVCNFSM6AAAAABFMOMYAGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRVGIYTSOBZGQ . You are receiving this because you commented.Message ID: @.***>

kleuter commented 4 months ago

Same problem guys, had to comment this requires line requires std::_Is_iterator_v

Seems like _Is_iterator_v is a Visual Studio thing

kleuter commented 4 months ago

Additionally, there's also (also Ubuntu 23.04)

/home/me/downloader-bot/TelegramBotAPI/./Internal/Utility/QHttpMultiPartInserter.hpp:7:119: error: cannot declare member function ‘static std::unique_ptr<QHttpMultiPart> Utility::QHttpMultiPartInserter::make(std::span<QString>, Args&& ...)’ to have static linkage [-fpermissive]
    7 | static std::unique_ptr<QHttpMultiPart> Utility::QHttpMultiPartInserter::make(std::span<QString> keys, Args&&... values) {
      |                                                                                                                       ^
In file included from /home/me/downloader-bot/TelegramBotAPI/Internal/Utility/QJsonObjectInserter.h:80,
                 from /home/me/downloader-bot/TelegramBotAPI/Bot.cpp:4:
/home/me/downloader-bot/TelegramBotAPI/./Internal/Utility/QJsonObjectInserter.hpp:8:96: error: cannot declare member function ‘static QJsonObject Utility::QJsonObjectInserter::make(std::span<QString>, Args&& ...)’ to have static linkage [-fpermissive]
    8 | static QJsonObject Utility::QJsonObjectInserter::make(std::span<QString> keys, Args&&... values) {
      |                                                                                                ^
gmake[2]: *** [TelegramBotAPI/CMakeFiles/TelegramBotAPI.dir/build.make:90: TelegramBotAPI/CMakeFiles/TelegramBotAPI.dir/Bot.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:170: TelegramBotAPI/CMakeFiles/TelegramBotAPI.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
me@pi5:~/downloader-bot/TelegramBotAPI$