Взываю ващей помощи, скока мучал дядющку google так они ничего и не выдал.
Код:
class LIST
{
...
friend ostream& operator<< (ostream&, const LIST<T>&);
...
}
...
template <typename T>
ostream& operator<< (ostream& p, const LIST<T>& L)
{
...
}
...
void TypeInt (void)
{
...
LIST <int> L;
...
cout<<"Current list:\t"<<L;
...
}
////////////EOF//////////////
:!make |& tee /tmp/v537941/6
c++ main.cpp -g3 -DFreeBSD -DDEBUG
main.cpp:48: warning: friend declaration 'std::ostream& operator<<(std::ostream&, DATA<T>&)' declares a non-template function
main.cpp:48: warning: (if this is not what you intended, make sure the function template has already been declared and add <> after the function name here) -
Wno-non-template-friend disables this warning
main.cpp:70: warning: friend declaration 'std::ostream& operator<<(std::ostream&, const LIST<T>&)' declares a non-template function
/var/tmp//ccKC61Po.o(.text+0x5ba): In function `TypeInt()':
/home/asm/Mtuci/cpp/OOP/Lab5/main.cpp:367: undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, LIST<int> const&)'
/var/tmp//ccKC61Po.o(.text+0xa04): In function `TypePoezd()':
/home/asm/Mtuci/cpp/OOP/Lab5/main.cpp:409: undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, LIST<POEZD> const&)'
collect2: ld returned 1 exit status
*** Error code 1
Ответ на:
комментарий
от Legioner
Ответ на:
комментарий
от Legioner
Ответ на:
комментарий
от ASM
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.
Похожие темы
- Форум [C++]ошибка компиляции (2010)
- Форум Глюк с gcc (2005)
- Форум все равно не могу скомпиллировать (2011)
- Форум iostream? (2003)
- Форум Не работает линкер. (2007)
- Форум Проблемы с gcc в Mandrake 10.1 (2005)
- Форум ppp over xmpp не компилируется :( (2009)
- Форум С++ (2006)
- Форум Хочу c++11 в gcc - не работает (2013)
- Форум Через g++ компилируется, через gcc не компилируется. (2013)