шаблоны — dev-c ++ g ++ — ошибка: имя типа / статическая константа undeclared (сначала используйте эту функцию)

Я продолжаю получать следующие ошибки о typename posizione и int константе POSIZIONENULLA. Странно, но я использовал тип posizione в моем коде, но получаю ошибки только в функции.

Coda.h:156: error: `template<class T> class Coda' used without template parameters
Coda.h: In function `typename Coda<T>::posizione copiaNodo(typename Coda<T>::posizione)':
Coda.h:158: error: `POSIZIONENULLA' undeclared (first use this function)
Coda.h:158: error: (Each undeclared identifier is reported only once for each function it appears in.)
Coda.h:161: error: `posizione' undeclared (first use this function)
Coda.h:161: error: expected `;' before "tempPosizione"Coda.h:162: error: `tempPosizione' undeclared (first use this function)
Coda.h:164: error: `temPosizione' undeclared (first use this function)
Coda.h: At global scope:
Coda.h:169: error: `template<class T> class Coda' used without template parameters
Coda.h: In function `void eliminaNodo(typename Coda<T>::posizione)':
Coda.h:171: error: `POSIZIONENULLA' undeclared (first use this function)
Coda.h:173: error: `posizione' undeclared (first use this function)
Coda.h:173: error: expected `;' before "tempPosizione"Coda.h:175: error: `tempPosizione' undeclared (first use this function) make: *** [Coda.o] Error 1

Я использую dev-c ++ 4.9.9.2 с g ++

Я загрузил весь исходный код @ http://ge.tt/9I0pXcS/v/0?c для вас, чтобы скомпилировать. для компиляции вы можете использовать файл make в папке «Coda» или запустить следующие команды в папке компилятора.

g ++ -g -c Coda.h -o Coda.o
ar crf Coda.a Coda.o

Я действительно помогу, ты можешь мне. Большое спасибо заранее за ваше время. Благодарю.

0

Решение

Coda.h:156: error: `template<class T> class Coda' used without template parameters

Это говорит о том, что вы положили Coda вместо Coda<something>,

Coda.h:158: error: `POSIZIONENULLA' undeclared (first use this function)

Вы не объявили POSIZIONENULLA,

Coda.h:161: error: `posizione' undeclared (first use this function)

Так же.

Coda.h:161: error: expected `;' before "tempPosizione"

Вы забыли точку с запятой ; в строке 161

Coda.h:162: error: `tempPosizione' undeclared (first use this function) а также Coda.h:164: error: `temPosizione' undeclared (first use this function)

То же, что и выше.

0

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector