Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. assertion errors

assertion errors

Scheduled Pinned Locked Moved C / C++ / MFC
helpgraphicsquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    theprinc
    wrote on last edited by
    #1

    I am trying to push a variable of type bobject into a vector, i get an assertion error when i try to push it. Does anybody know what the problem could be?

    PJ ArendsP 1 Reply Last reply
    0
    • T theprinc

      I am trying to push a variable of type bobject into a vector, i get an assertion error when i try to push it. Does anybody know what the problem could be?

      PJ ArendsP Offline
      PJ ArendsP Offline
      PJ Arends
      wrote on last edited by
      #2

      Show your code, especially how you declared your vector (be sure to check the 'Ignore HTML tags in the message' checkbox located below the posting edit box on the CP posting page), the line where you call push_back (or push_front) and then it might help if you also posted the lines that generated the actual assertion (will contaion the text ASSERT or VERIFY or some variation there of) that your debugger will jump to when you tell it to debug your program after the assertion happens.


      You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!

      Within you lies the power for good; Use it!

      T 1 Reply Last reply
      0
      • PJ ArendsP PJ Arends

        Show your code, especially how you declared your vector (be sure to check the 'Ignore HTML tags in the message' checkbox located below the posting edit box on the CP posting page), the line where you call push_back (or push_front) and then it might help if you also posted the lines that generated the actual assertion (will contaion the text ASSERT or VERIFY or some variation there of) that your debugger will jump to when you tell it to debug your program after the assertion happens.


        You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!

        T Offline
        T Offline
        theprinc
        wrote on last edited by
        #3

        The code which pushes the vector bobject o=read_Obj(argv[i]); o.active=1; //Active o.picked=0;//Not picked o.path=argv[i]; //save object path ---------------->store_normal(o); glLoadIdentity (); glGetFloatv(GL_MODELVIEW_MATRIX,o.m); //initialize all variables cout<<"in"<ob.MyObjects.push_back(o); the store_normal code is void store_normal(bobject o) { for(int i =0;i

        PJ ArendsP 1 Reply Last reply
        0
        • T theprinc

          The code which pushes the vector bobject o=read_Obj(argv[i]); o.active=1; //Active o.picked=0;//Not picked o.path=argv[i]; //save object path ---------------->store_normal(o); glLoadIdentity (); glGetFloatv(GL_MODELVIEW_MATRIX,o.m); //initialize all variables cout<<"in"<ob.MyObjects.push_back(o); the store_normal code is void store_normal(bobject o) { for(int i =0;i

          PJ ArendsP Offline
          PJ ArendsP Offline
          PJ Arends
          wrote on last edited by
          #4

          You have still not supplied the crucial piece of information, what is the exact assertion? Just saying "an assertion happened" means nothing, it could be anything. Learn to use the tools you have in front of you. Start the debugger, step through and into your code. Watch the values of all your variables, and when you hit an assertion look at the code and all the variables referenced in that code. At least one of the variables will have an invalid value. Figure out which one it is, and then use the call stack to backtrace to where that invalid value was set. It can take a little bit of detective work, but you can do it. I can't do it with the information you have supplied so far. Good Luck!:)


          You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!

          Within you lies the power for good; Use it!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups