"fatal error: definition of type 'QStringList' conflicts with type alias of the same name" when building on macOS
msdf2244 opened this issue · 5 comments
It looks like you have Qt installed in two places and they are conflicting with each other. I think /usr/local/include
is the default directory for header files on Mac, which makes this difficult since it will automatically include those header files.
If you could delete the Qt header files in /usr/local/include
the build might succeed, but that's obviously not a great solution.
I don't know how to solve this issue in a good way right now. If anyone with more Mac experience knows a way, please let me know.
You were correct. I had qt 6 installed as a dependency for something else. I ended up removing it. Thanks for the help.
Hi 👋 Could we please keep this issue open? I'm experiencing the same exact compilation error but can't remove Qt6 because other installed software depends on it. There must be a way to configure the build environment so that it uses the Qt version it's told to use and not an automatically detected one.
Sure, unfortunately I don't know how to fix this since I've never really dealt with Linux/macOS and shared libs much.
came here from the following web search
qcoreapplication.h error: definition of type 'QStringList' conflicts with type alias of the same name
this appeared on the first page of my search results
i'm no expert so forgive me if i stepping out of bounds here.
i came across this issue today as well, but with building freecad on macos catalina.
freecad still relies on qt v5 and macos homebrew provides both qt v6 and v5.
the quick fix is to unlink qt v6 if you're building with cmake
brew unlink qt
i tried prepending my path with the /usr/local/opt/qt@5/bin
but that unfortunately that's not enought for the cmake process to not pick up on the qt v6 installation. so during your cmake build steps unlinking qt v6 if your building against qt v5 aiding in my freecad installation process in not having this error.
i hope this helps.