epasveer / seer

Seer - a gui frontend to gdb
GNU General Public License v3.0
2.09k stars 66 forks source link

"filesystem" header missing #151

Closed ell1e closed 10 months ago

ell1e commented 11 months ago

On OpenSuse, I'm getting the following error building v2.2:

In file included from /usr/include/qt6/QtCore/qdir.h:8:0,
                 from /usr/include/qt6/QtCore/QtCore:76,
                 from /home/user/Develop/seer/src/build/seergdb_autogen/EWIEGA46WW/../../../GdbMonitor.h:5,
                 from /home/user/Develop/seer/src/build/seergdb_autogen/EWIEGA46WW/moc_GdbMonitor.cpp:10,
                 from /home/user/Develop/seer/src/build/seergdb_autogen/mocs_compilation.cpp:2:
/usr/include/qt6/QtCore/qfile.h:13:10: fatal error: filesystem: No such file or directory
 #include <filesystem>
          ^~~~~~~~~~~~
compilation terminated.

I noticed even though gcc/g++ 10 is installed it picks version 7 which I assume is the problem. But neither did I tell the build process to do that, nor do I know how to switch that out. Is there some common approach to fix that? Maybe in that case a note in the README would be useful. (Nevertheless, this is more of a confused question than a bug report, I realize this is mostly my own mistake of whatever kind!)

Edit: okay, I managed to switch the short hand PATH names gcc and g++ to default to version 10, sadly that didn't fix it. I can't tell from the very limited output cmake provides if it's still managing to use version 7, or what specifically is going on. If someone else knows how to solve this mystery, I'd appreciate hints!

ell1e commented 11 months ago

Okay, so I figured it out. Install gcc/g++ 12 (10 is not enough, although you can leave it around) and then for openSUSE, these commands worked for me:

$ sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-12 80
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 80
$ sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-12 80
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 80

Hopefully this will help the next person running into this and searching the issues for what's going on. But yeah, you need gcc and g++ version 12 at least, it seems like.

epasveer commented 11 months ago

Hi Ellie,

I use Opensuse as well. Haven't come across this.

Are you using Leap? Or Tumbleweed? What version?

I believe your the second person to come across this. I may have to put some in the cmake file for opensuse.

I'll look into it soon.

ell1e commented 11 months ago

OpenSUSE Leap, I imagine this is mainly a distribution issue and the best place to fix this might be either 1. in the README, 2. and/or by providing a distribution independent prebuilt binary e.g. via flatpak or via an ELF binary in a .zip here on GitHub to make it a little easier to get started.

But I figured many searching for this problem will just find this ticket, so hopefully that might be a good starting point already for whoever still runs into this.

epasveer commented 11 months ago

I might be able to add a check in the Cmakefile to check the g++ version when Qt6 and OpenSuse are used,

epasveer commented 10 months ago

Note for myself.

Qt says it needs C++17 for Qt6. I'll see if I can put something in the CMakefile.txt file to insure this. As well as add a comment to the build instructions.

epasveer commented 10 months ago

This should be fixed. I added a check in the CMakefile to print a better message if the c++ compiler isn't the right version.