Czy z bardziej rozwiniętym ostrzeżeniem już widzisz, czy potrzebujesz dalszego nakierowywania?
skasujmnie.cpp:11:61: warning: friend declaration ‘std::ostream& operator<<(std::ostream&, Test<t>&)’ declares a non-template function [-Wnon-template-friend]
11 | friend ostream &operator<<(ostream &stream, Test<t> &obj);
| ^
skasujmnie.cpp:11:61: note: (if this is not what you intended, make sure the function template has already been declared and add ‘<>’ after the function name here)
/usr/bin/ld: /tmp/ccg0EwWO.o: in function `main':
skasujmnie.cpp:(.text+0x3a): undefined reference to `operator<<(std::ostream&, Test<int>&)'
nie wiem jak to zrobiłeś ale u mnie inaczej kompilator gada
zabawa2/main.cpp:36: undefined reference to `operator<<(std::ostream&, Test<int>&)'
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [Makefile.Debug:71: debug/zabawa2.exe] Error 1
mingw32-make[1]: Leaving directory 'C:/Projekty-Qt/konsolowki/zabawa2/zabawa2-Debug'
mingw32-make: *** [Makefile:45: debug] Error 2
17:57:14: Proces "C:\Qt\Qt-6.3.0\Tools\mingw1120_64\bin\mingw32-make.exe" zakończył się kodem wyjściowym 2.
Błąd budowania / instalowania projektu zabawa2 (zestaw narzędzi: Desktop Qt 6.3.0 MinGW 64-bit)
Podczas wykonywania kroku "Make"