fork download
  1. #include <iostream>
  2. using namespace std;
  3. struct Card
  4. {};
  5.  
  6. struct CardDeck
  7. {
  8. CardDeck(const Card& card);
  9. friend CardDeck operator+(const CardDeck&, const CardDeck&);
  10. };
  11.  
  12. CardDeck operator+(const CardDeck&, const CardDeck&);
  13.  
  14. int main()
  15. {
  16. Card c1;
  17. CardDeck cd(c1);
  18. Card myCard;
  19. CardDeck cd2 = myCard + myCard;
  20. return 0;
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/wZlnDx/ccQ0OJTh.o: In function `main':
prog.cpp:(.text.startup+0x22): undefined reference to `CardDeck::CardDeck(Card const&)'
prog.cpp:(.text.startup+0x2b): undefined reference to `CardDeck::CardDeck(Card const&)'
prog.cpp:(.text.startup+0x37): undefined reference to `CardDeck::CardDeck(Card const&)'
prog.cpp:(.text.startup+0x45): undefined reference to `operator+(CardDeck const&, CardDeck const&)'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty