# compile error in MinGW (gcc 3.4.2)

This topic is 4815 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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]

##### Share on other sites
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

##### Share on other sites
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?

##### Share on other sites
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.

##### Share on other sites
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