строка cstdint c ++> C11 int / usr / include / c ++ / 8 / cstdint: 53: 11: ошибка: ':: int_fast8_t' не была объявлена - PullRequest
0 голосов
/ 07 февраля 2020

У меня есть программа, написанная в C ++ 1996, и я хотел бы скомпилировать ее в C ++ 17. Я получаю сообщение об ошибке, когда добавляю #include, и я ссылаюсь на cstdint. Здесь отсутствует объявление:

/ usr / include / c ++ / 8 / cstdint: 51: 11: error: ":: int64_t" has not been declared
   using :: int64_t;
           ^ ~~~~~~
/ usr / include / c ++ / 8 / cstdint: 53: 11: error: ":: int_fast8_t" has not been declared
   using :: int_fast8_t;
           ^ ~~~~~~~~~~
In file included from /usr/include/c++/8/bits/char_traits.h:503,
                 from / usr / include / c ++ / 8 / string: 40,
/ usr / include / c ++ / 8 / cstdint: 53: 11: error: ":: int_fast8_t" has not been declared
   using :: int_fast8_t;
           ^ ~~~~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 54: 11: error: ":: int_fast16_t" has not been declared
   using :: int_fast16_t;
           ^ ~~~~~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 55: 11: error: ":: int_fast32_t" has not been declared
   using :: int_fast32_t;
           ^ ~~~~~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 56: 11: error: ":: int_fast64_t" has not been declared
   using :: int_fast64_t;
           ^ ~~~~~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 58: 11: error: ":: int_least8_t" has not been declared
   using :: int_least8_t;
           ^ ~~~~~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 59: 11: error: ":: int_least16_t" has not been declared
   using :: int_least16_t;
           ^ ~~~~~~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 60: 11: error: ":: int_least32_t" has not been declared
   using :: int_least32_t;
           ^ ~~~~~~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 61: 11: error: ":: int_least64_t" has not been declared
   using :: int_least64_t;
           ^ ~~~~~~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 63: 11: error: ":: intmax_t" has not been declared
   using :: intmax_t;
           ^ ~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 71: 11: error: ":: uint_fast8_t" has not been declared
   using :: uint_fast8_t;
           ^ ~~~~~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 72: 11: error: ":: uint_fast16_t" has not been declared
   using :: uint_fast16_t;
           ^ ~~~~~~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 73: 11: error: ":: uint_fast32_t" has not been declared
   using :: uint_fast32_t;
           ^ ~~~~~~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 74: 11: error: ":: uint_fast64_t" has not been declared
   using :: uint_fast64_t;
           ^ ~~~~~~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 76: 11: error: ":: uint_least8_t" has not been declared
   using :: uint_least8_t;
           ^ ~~~~~~~~~~~~
/ usr / include / c ++ / 8 / cstdint: 77: 11: error: ":: uint_least16_t" has not been declared

Если я скомпилирую программу в c ++ 98, у меня нет проблем.

У кого-нибудь было это раньше, или вы знаете решение? ?

Привет Андре

1 Ответ

0 голосов
/ 10 февраля 2020

Решил мою программу, и с удовольствием поделюсь ей. После долгих поисков я случайно обнаружил причину проблемы CSTDINT / STRING.

В #INCLUDE STRING вызывается функция #INCLUDE CSTDINT, а в #INCLUDE CSTDINT #INCLUDE STDINT.H вызывается. Теперь в моей программе есть и stdint.h, и один в компиляторе, и это дает проблему.

Как решить. Найдите в программе файл stdint.h и удалите его. Это все люди

...