Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

compile error in MinGW (gcc 3.4.2)


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
4 replies to this topic

#1 redpixel   Members   -  Reputation: 122

Like
0Likes
Like

Posted 15 November 2004 - 04:58 PM

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]

#2 Andreas Jonsson   Moderators   -  Reputation: 4291

Like
0Likes
Like

Posted 16 November 2004 - 03:42 AM

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

#3 Roboguy   Members   -  Reputation: 794

Like
0Likes
Like

Posted 16 November 2004 - 03:53 AM

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?

#4 Andreas Jonsson   Moderators   -  Reputation: 4291

Like
0Likes
Like

Posted 16 November 2004 - 04:02 AM

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

#5 redpixel   Members   -  Reputation: 122

Like
0Likes
Like

Posted 16 November 2004 - 01:40 PM

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




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.




PARTNERS