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

Fix ubuntu 20 build because of underlying type mismatch #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vale1410
Copy link

@vale1410 vale1410 commented Feb 3, 2021

Under ubuntu 20.04 and compilation as described in the readme I ran into:

In file included from /home/valentin/code/sat/qute/src/dependency_manager_rrs.cc:1:
/home/valentin/code/sat/qute/src/dependency_manager_rrs.hh:19:6: error: enumeration previously declared with fixed underlying type
enum ConstraintType;
     ^
/home/valentin/code/sat/qute/src/solver_types.hh:43:6: note: previous declaration is here
enum ConstraintType: unsigned short { clauses = 0, terms = 1 };
     ^
1 error generated.

I had to make the type of the enum explicit and the compilation worked.
https://stackoverflow.com/questions/42766839/c11-enum-forward-causes-underlying-type-mismatch#42768812

@fslivovsky
Copy link
Owner

Thanks for pointing this out! I think we don't need the forward declaration here and should instead include "solver_types.hh". Which compiler and version of CMake are you using? I couldn't reproduce the error on Ubuntu 20.04.1 LTS using GCC 9.3.0 and CMake 3.16.3.

@vale1410
Copy link
Author

vale1410 commented Feb 7, 2021

Looks like my c/c++ compiler was set to Clang-10. Still something to look into maybe!
CMakeCache.txt

@fslivovsky
Copy link
Owner

Removing the inconsistent forward declarations fixed the problem with Clang on macOS, I expect this also works for Ubuntu.

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

Successfully merging this pull request may close these issues.

2 participants