Compiler Error with Bool

Compiler Error with Bool

Postby dulsi » 07 Nov 2016, 02:34

Bt Builder is failing on powerpc. It gets:

{l Code}: {l Select All Code}
src/psuedo3d.h:18:129: error: could not convert 'true' from 'bool' to '__vector(4) __bool int'
   virtual void loadImageOrAnimation(const char *file, SDL_Surface **img, MNG_Image **animation, bool imageWindow, bool physfs = true) = 0;
                                                                                                                                 ^~~~

I've been told that it can be fixed by -std=gnu++11 instead of using -std=c++11. I was wondering if anyone knows why. Is it bug in the compiler or my code?
dulsi
 
Posts: 89
Joined: 18 Feb 2016, 15:24

Re: Compiler Error with Bool

Postby Lyberta » 07 Nov 2016, 04:43

I have no idea what
{l Code}: {l Select All Code}
'__vector(4) __bool int'
is. Looks like implementation specific stuff.
Some crazy person on the Internet.
User avatar
Lyberta
 
Posts: 353
Joined: 19 Jun 2013, 10:45

Re: Compiler Error with Bool

Postby Pix3l » 12 Dec 2016, 22:12

Look if that the source include stdbool.h, maybe is just that the problem :]
http://indiefanmagazine.blogspot.com/ - Your 1st source for Gaming and Dev!
User avatar
Pix3l
 
Posts: 49
Joined: 10 Sep 2010, 21:00
Location: Italy

Re: Compiler Error with Bool

Postby Lyberta » 13 Dec 2016, 03:54

You don't need stdbool.h in C++.
Some crazy person on the Internet.
User avatar
Lyberta
 
Posts: 353
Joined: 19 Jun 2013, 10:45

Re: Compiler Error with Bool

Postby dulsi » 07 Apr 2017, 16:49

From Bug 1394505:

f you build with -std=c++11 (or any other strict ISO mode) and include altivec.h, that is to be expected, altivec.h redefines bool and vector for the Altivec purposes, so if you want to use it in C++ code, you need to include altivec.h after all STL headers and if you want to use bool/vector the way it is used normally in C++, you need to #undef them afterwards. In -std=gnu++11 and other GNU modes GCC uses conditional preprocessor macros that act as the Altivec macros in certain contexts and as normal C++ bool/vector in other contexts.


I don't find the answer very satisfying. Since it compiles on everything except PowerPC, something is including altivec.h on that platform. I have no idea what. Even if I found it and moved everything so that altivec.h is included last, someone could decide they need altivec in a library I use and break the build again. So I'm stuck using gnu++11.
dulsi
 
Posts: 89
Joined: 18 Feb 2016, 15:24

Who is online

Users browsing this forum: No registered users and 1 guest