fph / bastet

Evil falling block game. http://fph.altervista.org/prog/bastet.html
GNU General Public License v3.0
272 stars 35 forks source link

error: friend declaration specifying a default argument must be a definition #3

Closed ryandesign closed 10 years ago

ryandesign commented 10 years ago

Hello, bastet 0.43.1 fails to build for me on OS X:

/usr/bin/clang++ -Os -arch x86_64 -DNDEBUG -Wall   -c -o Ui.o Ui.cpp
In file included from Ui.cpp:19:
In file included from ./Ui.hpp:22:
./Well.hpp:69:17: error: friend declaration specifying a default argument must be a definition
    friend long Evaluate(const Well *w, int extralines=0); //for BastetBlockChooser
                ^
1 error generated.
fph commented 10 years ago

Please let me know if it works now from head (0323cb4)

ryandesign commented 10 years ago

Thanks. The next problem I see is:

/usr/bin/clang++ -Os -arch x86_64 -DNDEBUG -Wall   -c -o Test.o Test.cpp
Test.cpp:13:19: error: no matching function for call to 'Evaluate'
  cout<<"Score:"<<Evaluate(w)<<endl;
                  ^~~~~~~~
./Well.hpp:69:17: note: candidate function not viable: requires 2 arguments, but 1 was provided
    friend long Evaluate(const Well *w, int extralines); //for BastetBlockChooser
                ^
Test.cpp:20:19: error: no matching function for call to 'Evaluate'
  cout<<"Score:"<<Evaluate(w)<<endl;  
                  ^~~~~~~~
./Well.hpp:69:17: note: candidate function not viable: requires 2 arguments, but 1 was provided
    friend long Evaluate(const Well *w, int extralines); //for BastetBlockChooser
                ^
2 errors generated.