Skip to content
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

coding error #7

Open
damahou66826 opened this issue Apr 14, 2022 · 4 comments
Open

coding error #7

damahou66826 opened this issue Apr 14, 2022 · 4 comments

Comments

@damahou66826
Copy link

when I run make, come on the following error:

maxhs/core/Wcnf.cc: 在成员函数‘void Wcnf::_addSoftClause(std::vector<Minisat::Lit>&, Weight)’中: maxhs/core/Wcnf.cc:157:25: 错误:不能将‘double modf(double, double*)’的实参‘2’从‘Weight* {aka long double*}’转换到‘double*’ if (modf(w, &intPart) > 0) intWts = false;

@fbacchus
Copy link
Owner

I can't understand the compiler message (unfortunately I don't read Mandarin). When I compile on ubuntu 20.04 using and gcc (g++) 9.3.0. there is no error. I also tried g++ 8.4.0 again no errors or compiler messages.

a) what is the message you are getting in English?
b) what compiler version and system are you using?
c) what version of MaxHS are you trying to compile?

@fbacchus fbacchus reopened this Apr 15, 2022
@damahou66826
Copy link
Author

  • my system: Centos 7
  • MaxHs version: 3.2
  • g++ version: 5.4
  • the error:
    maxhs/core/Wcnf.cc: 在成员函数‘void Wcnf::_addSoftClause(std::vector<Minisat::Lit>&, Weight)’中: maxhs/core/Wcnf.cc:157:25: 错误:不能将‘double modf(double, double*)’的实参‘2’从‘Weight* {aka long double*}’转换到‘double*’ if (modf(w, &intPart) > 0) intWts = false;

@damahou66826
Copy link
Author

I can't understand the compiler message (unfortunately I don't read Mandarin). When I compile on ubuntu 20.04 using and gcc (g++) 9.3.0. there is no error. I also tried g++ 8.4.0 again no errors or compiler messages.

a) what is the message you are getting in English? b) what compiler version and system are you using? c) what version of MaxHS are you trying to compile?

  • my system: Centos 7
  • MaxHs version: 3.2
  • g++ version: 5.4
  • the error:
    maxhs/core/Wcnf.cc: 在成员函数‘void Wcnf::_addSoftClause(std::vectorMinisat::Lit&, Weight)’中: maxhs/core/Wcnf.cc:157:25: 错误:不能将‘double modf(double, double*)’的实参‘2’从‘Weight* {aka long double*}’转换到‘double*’ if (modf(w, &intPart) > 0) intWts = false;

@fbacchus
Copy link
Owner

Your g++ compiler is ancient and does not support
long double modf(long double, long double)
added to C++ a long time ago.

Upgrade to a more recent version of g++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants