Closed ycollet closed 3 years ago
that looks pretty much like a problem in libsmf. I'll look into it, thanks for reporting. regards hermann
I agreed. I tried to include smf.h in extern "C" in mamba.h and it doesn't fix anything. Looking into smf.h ....
I don't know exactly, but usually you included other headers outside the extern "C" macro, in smf.h I see that stdio.h and glib.h been included inside the macro. That may be a problem with gcc 11 but I don't know.
I met the same kind of problem with gxtuner. gcc 11 enable c++17 by default. Maybe the problem comes from here ...
Ah, maybe it helps to add -std=c++11 to the CXXFLAGS in the makefile?
No, not yet. I set CXXFLAGS=-std=C++11 and I realized that the Makefile managed CPPFLAGS instead of CXXFLAGS. So, I tried to add -std=c++11 to CPPFLAGS. But still the same problem. I am looking for a solution ...
I tried the -fno-new-ttp-matching flags from the changeog https://gcc.gnu.org/gcc-11/changes.html But It doesn"t works.
Finally, this combination has worked for gxtuner: export CPPFLAGS="-D__cplusplus -std=c++11 $CXXFLAGS"
Doesn't work for Mamba. I stop for the night ...
The Mamba makefile use CXXFLAGS I've added the -std=gnu++14 flag now, hope that helps.
I do some tests with -std=gnu++17, found some issues in the Mamba source which I've solved now. But the issue with libsmf I can't reproduce here when build with gnu++17 enabled. True, I'm still on the gcc version 10.2.1
So I do some research on this issue, and it seems that indeed the issue is that smf.h include glib.h in a extern "C" block. That is still no problem here on debian/sid with gcc 10.2, but maybe gcc-11 is a bit more strict about that. I found a possible workaround for that, by including type_traits in a external C++ block before include smf.h Still I didn't realy know if that works or not, as we don't have gcc-11 on debian jet. You may try it your self before I push such a change to the repository. Just open the file mamba.h and insert the following block
extern "C++" {
#include <type_traits>
}
just above the line
#include <smf.h>
let me know if that helps, if so I'll add it to the repository. regards hermann
Thanks a lot, I will try ASAP.
Works here. Thanks for this fix.
Okay, nice, So I've pushed it to the repository now. Closed this issue.
Hello, I am trying to compile mamba on fedora 34 beta with gcc-11 and I met the following error message: