niklasso / minisat

A minimalistic and high-performance SAT solver
minisat.se
Other
1.01k stars 381 forks source link

error: friend declaration of 'Minisat::Lit mkLit(Minisat::Var, bool)' specifies default arguments and isn't a definition #45

Open trcrsired opened 2 years ago

trcrsired commented 2 years ago

Compilation error with GCC13 ./minisat/core/SolverTypes.h:55:16: error: friend declaration of 'Minisat::Lit mkLit(Minisat::Var, bool)' specifies default arguments and isn't a definition [-fpermissive] 55 | friend Lit mkLit(Var var, bool sign = false); | ^~~~~ ./minisat/core/SolverTypes.h:63:14: error: friend declaration of 'Minisat::Lit Minisat::mkLit(Var, bool)' specifies default arguments and isn't the only declaration [-fpermissive] 63 | inline Lit mkLit (Var var, bool sign) { Lit p; p.x = var + var + (int)sign; return p; } | ^~~~~ ./minisat/core/SolverTypes.h:55:16: note: previous declaration of 'Minisat::Lit Minisat::mkLit(Var, bool)' 55 | friend Lit mkLit(Var var, bool sign = false); | ^~~~~ In file included from ./minisat/mtl/Alg.h:24,

medovina commented 2 years ago

I'm seeing this too, with gcc 11.2.0 on Ubuntu 22.04.

medovina commented 2 years ago

Actually this is a duplicate of #16, and there is a bunch of discussion there. For that reason, I recommend closing this issue.