-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declaration of mkLit breaks compilation on OS X (with clang-503.0.40) #16
Comments
… arg closes niklasso#16 Signed-off-by: u-u-h <[email protected]>
#elif defined(__APPLE__)
#include
double Minisat::memUsed(void) {
malloc_statistics_t t;
malloc_zone_statistics(NULL, &t);
return (double)t.max_size_in_use / (1024*1024); }
double Minisat::memUsedPeak(void) {return memUsed(); }
#else |
I just ran into this same issue. Is there any update on what I should do (just apply zhzdeng's patch?) |
The fastest solution is probably to clone one of the forks in which this issue (and a few others) has been fixed. agurfinkel/minisat should work, for example. |
This commit off of agurfinkel/minisat resolves OSX linking issues I faced. |
Think that worked for me too. Thanks! |
When building minisat on OS X, with clang-503.0.40, the compilation breaks with the following error:
The issue seems to be with the friend declaration of mkLit within the structure Lit, which specifies a default value. According to ISO C++11 standard, such a declaration is illegal:
"If a friend declaration specifies a default argument expression, that declaration shall be a definition and shall be the only declaration of the function or function template in the translation unit.”
An obvious fix is to remove the declaration, as there is no real reason for mkLit to be declared as friend. The default value should instead be specified in the definition of mkLit.
The text was updated successfully, but these errors were encountered: