iso c++ forbids declaration of 'Collision' with no type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BrucePerry
    New Member
    • Dec 2011
    • 7

    iso c++ forbids declaration of 'Collision' with no type

    I get that error above on a few line in my code.
    Code:
    #include "Collision.h"
    
    Collision::Collsion()
    {           //this line
    
    }
    Collision::~Collision()
    {
                           
    }
    void Collision::Init()
    {
         loadCounterX = loadCounterY = 0;
         Collision::LoadCollisionMap("colmap1.txt");
    {
    
    void Collision::Update()
    {  //this line
    
    }
    But I'm quite sure it has something to do with my class files, and for the life of me I cannot fix it.

    Thanks in advance.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Collision::Coll sion

    You are missing an i in the second Collision. Alternatively you have put the i in before the ::.

    In any case check all your files to make sure you have the spellings correct.

    If that doesn't fix it post your header file too.

    Comment

    • BrucePerry
      New Member
      • Dec 2011
      • 7

      #3
      I did post a link but edited it out because it is broken.
      Last edited by BrucePerry; Dec 14 '11, 01:49 AM. Reason: Broken link.

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        that link produces "Server not found" and in general we prefer code posted directly into the thread rather than a link to some net paste bin.

        Comment

        • BrucePerry
          New Member
          • Dec 2011
          • 7

          #5
          I haven't posted the code because it has quite a few classes and I can bet that the problem isn't in the one that it says its in.
          Edit: I fixed it by putting "class Collision" at the top of my code!

          Comment

          Working...