compile error in MinGW (gcc 3.4.2)

Started by
3 comments, last by redpixel 19 years, 5 months ago
trying to compile AS using MinGW/gcc 3.4.2, I got this error. I tested with both version(AS 1.10.1 WIP 3, AS 1.10 release). ----------------------------------------------------------- g++ -ggdb -o obj/as_string.o -c ../../source/as_string.cpp In file included from ../../source/as_config.h:227, from ../../source/as_string.cpp:31: ../../source/../include/angelscript.h: In static member function `static asUPtr asSMethodPtr<N>::Convert(M)': ../../source/../include/angelscript.h:383: error: size of array `ERROR_UnsupportedMethodPtr' is negative make: *** [obj/as_string.o] Error 1 ----------------------------------------------------------- I don't know why... please patch this. it's my first compile. -_-a - redpixel [Edited by - redpixel on November 16, 2004 1:03:34 AM]
Advertisement
Strange, I compile with MinGW all the time.

Maybe it's something with the version of MinGW that you are using.

Anyway, you can resolve this problem by commenting the line 383 in angelscript.h:

// int ERROR_UnsupportedMethodPtr[-1];


Hope that helps.
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Obviously gcc 3.4 doesn't like arrays with negative sizes. Out of curiosity, why would you want it to have a size of -1?
No compiler should allow arrays of negative size. Which is exactly why I used it in this case. If this templated function is ever called something is terribly wrong, that's why I added the negative array, so that the compiler can give an error already at compile stage.

In redpixel's case the templated function is compiled without it being instanciated, so the failsafe backfired.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Thanks for reply. I found that compiling AS with MinGW 3.3.1 is good. maybe because gcc 3.4.2 is more harsh.

- redpixel

This topic is closed to new replies.

Advertisement