View Full Version : Does anyone here use g++ ? I'm getting some weird error when going from VS 2003 code.

10-24-2003, 12:18 PM
OK, there error from my previous post...
It seems that it is not related to glut or Opengl linking, but to my code... But the code has cimpiled ok under VS2002, 2003 and Borland... If someone coudl please look at this (maybe it is a known 'bug' in g++) I'd really appreciate it.
Basically, the error I'm getting is this:
Asteroids.cpp: In method `Asteroids::Asteroids(const vector<Point,allocator<Point> > &)':
Asteroids.cpp:23: warning: assignment to `int' from `double'
Asteroids.cpp:31: warning: assignment to `int' from `double'
Asteroids.cpp:38: warning: assignment to `int' from `double'
AsteroidsComposite.cpp: In method `void
AsteroidsComposite: http://www.opengl.org/discussion_boards/ubb/redface.gifnHit(int)':
AsteroidsComposite.cpp:154: no matching function for call to `vector<vector<Point,allocator<Point> > *,allocator<vector<Point,allocator<Point> > *> >::at (int)'

Again, I don't quite understand what it means :-( It worked 100% well with the above compilers...

Huge thanks,

10-25-2003, 01:54 AM
A lot of code did not compile anymore after stricter checking was the new default a couple years ago. Particulary for the STL was a "using namespace std;" needed.

10-25-2003, 12:51 PM
Everything has 'using namespace std;' at the beginning though, I checked that...

10-26-2003, 04:15 AM
Are the types correct? That also includes const if you are using it.
Are you building with g++ or gcc?

10-27-2003, 04:23 AM
Post some code from your AsteroidComposite class where the errors are being reported.

[This message has been edited by Deiussum (edited 10-27-2003).]