Results 1 to 5 of 5

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

  1. #1
    Senior Member Regular Contributor
    Join Date
    Jul 2003
    Location
    London
    Posts
    163

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

    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: nHit(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,
    Luke

  2. #2
    Guest

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

    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.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Jul 2003
    Location
    London
    Posts
    163

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

    Everything has 'using namespace std;' at the beginning though, I checked that...

  4. #4
    Guest

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

    Are the types correct? That also includes const if you are using it.
    Are you building with g++ or gcc?

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

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

    Post some code from your AsteroidComposite class where the errors are being reported.

    [This message has been edited by Deiussum (edited 10-27-2003).]
    Deiussum
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. Replies: 3
    Last Post: 09-25-2013, 04:53 PM
  2. weird collada error
    By manny33 in forum COLLADA
    Replies: 1
    Last Post: 11-08-2009, 11:45 AM
  3. weird error.
    By ElectronicTempest in forum OpenGL: Linux
    Replies: 11
    Last Post: 06-06-2005, 02:31 AM
  4. "weird error"
    By JOSE ML in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 09-09-2002, 05:09 PM
  5. Weird compile error
    By Mats in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 08-10-2000, 04:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean