Skip to content

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