473,388 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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

I get that error above on a few line in my code.
Expand|Select|Wrap|Line Numbers
  1. #include "Collision.h"
  2.  
  3. Collision::Collsion()
  4. {           //this line
  5.  
  6. }
  7. Collision::~Collision()
  8. {
  9.  
  10. }
  11. void Collision::Init()
  12. {
  13.      loadCounterX = loadCounterY = 0;
  14.      Collision::LoadCollisionMap("colmap1.txt");
  15. {
  16.  
  17. void Collision::Update()
  18. {  //this line
  19.  
  20. }
  21.  
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.
Dec 13 '11 #1
4 1951
Banfa
9,065 Expert Mod 8TB
Collision::Collsion

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.
Dec 13 '11 #2
I did post a link but edited it out because it is broken.
Dec 13 '11 #3
Banfa
9,065 Expert Mod 8TB
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.
Dec 13 '11 #4
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!
Dec 14 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Henrik S. Hansen | last post by:
I'm new to C++, and cannot figure out why this won't compile: std::map<std::string, int> tst; tst = 1; int main() { /*...*/ } It gives me: error: ISO C++ forbids declaration of `tst' with...
5
by: j0mbolar | last post by:
operator = (const char *string) { if(m_string) { free(m_string); m_string = 0; } if(string) { m_string = strdup(string); } }
4
by: Juhan Voolaid | last post by:
Hi I need help here. When i compile my program, i get this error: $ make g++ -c -Wall inf2_functions.cpp -o inf2_functions.o inf2_classes.h:6: error: ISO C++ forbids declaration of ‘vector’...
3
by: gamehack | last post by:
Hi all, Here's the error which I'm getting when trying to compile some code: boxmanager.h:16: error: ISO C++ forbids declaration of 'vector' with no type boxmanager.h:16: error: expected...
1
by: eric | last post by:
hello i'm trying to implement some functionality whereby an algorithm in a base template class relies on a function pointer supplied by a derived template class. the types are only specified by...
7
by: Florian Haag | last post by:
Hello, I'm trying to compile a programme which compiles fine under Linux; I'm trying it with MinGW G++ 3.4.2: Component.h: #ifndef COMPONENT_H_ #define COMPONENT_H_
6
by: mkborregaard | last post by:
Hi, I am getting an error message from MinGW that I just cannot figure what causes. The error message is: "Line 16: ISO C++ forbids declaration of 'AreaMap' with no type" My code is: #ifndef...
8
by: aneuryzma | last post by:
Hello, I'm merging an OpenCV app with an Ogre3d app. I'm on a mac, I'm using xCode. When I add #include "openCVApp.h" I got the following error:
6
by: samsneelam | last post by:
Hi.. This is samuel, while doing a program, i encountered this problem.. Let me give you clarity regarding my prob.. I am having two files .. one is mpcplib.h it contains the follwing...
10
by: tvnaidu | last post by:
I am using Three pthread functions below, I got ISO error, then I declared int variable called val123, then I assigned, but still I am getting error, any idea?. also I included pthread.h. compiling...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.