User forums > Help
Code::Blocks has got some SERIOUS issues!
Someone1:
It's not so early anymore, and I'm getting very frustrated due to what time it is.
Please read CAREFULLY what I am writing so I don't have to re-post this again, and again.
I first declared a class, in C++, in another header. The code is as follows:
(This is an INCOMPLETE snippet of my code)
--- Code: ---class game{
struct color{int r,g,b,n;};
struct screen_color{color c;};
bool collision (int X, int Y, int x, int y);
int Time;
};
--- End code ---
Then, I decided I wanted to change my class name, but I had used the class name (thus the functions including) in my main.cpp file.
I used Code::Block's "replace" tool to replace all instances of "game" in BOTH my header AND my main (I re-did this twice..).
I then tried to execute my code, but Code::Blocks returned MANY instances of this error:
--- Code: ---Expected primary-expression before ‘.’ token
--- End code ---
What this means - which you all know - is that it doesn't interpret the class itself which was initialized before (game.collision(...)).
Now. What I did was I changed the class name ONLY!, leaving ALL other instances of the old class name be.
The new class name is game1...
Now, it only returns ONE single error.. That is right, only ONE error... despite having many instances of undeclared class names being used.
This error is:
--- Code: --- expected initializer before '.' token
--- End code ---
Now, I ask you, forum, what in the HECK is wrong here? Is it me who's too tired to see the problems in my code? I can't understand why Code::Blocks works the way it does.
It should at the VERY least return multiple errors.. not just ONE.
Someone1:
Okay, here's some more troubling news for everyone.
You know, I said it only returns one error, right?
Check this out: when I remove "game1" from my function declaration:
--- Code: ---bool game1::collision (int X, int Y, int x, int y)
--- End code ---
It returns errors from OUTSIDE OF THIS FUNCTION -- which does NOT relate to the function at all.
What.. the heck is this? If you didn't get that. When I ACTUALLY make an error (Code::Blocks is reporting false errors) in the code, Code::Blocks returns NON-errors.
It returns code which is fine, as faulty...
oBFusCATed:
Probably start by reading this: http://wiki.codeblocks.org/index.php?title=FAQ-General#Q:_What_Code::Blocks_is_not.3F
C++ is not Java, so the rename tool (Code refactoring -> Rename symbols) is useless 99% of the time.
If you've used Search -> Replace in files, then just fix your code and make sure you've used 'whole word' and 'match case'.
For the single error problem - most compilers aren't that smart to show all errors at once.
Someone1:
--- Quote from: oBFusCATed on September 27, 2012, 12:21:04 am ---Probably start by reading this: http://wiki.codeblocks.org/index.php?title=FAQ-General#Q:_What_Code::Blocks_is_not.3F
C++ is not Java, so the rename tool (Code refactoring -> Rename symbols) is useless 99% of the time.
If you've used Search -> Replace in files, then just fix your code and make sure you've used 'whole word' and 'match case'.
For the single error problem - most compilers aren't that smart to show all errors at once.
--- End quote ---
Oh, right. So technically, the lack of errors being displayed properly is not Code::Blocks' issue - it is the underlaying compiler?
I will see to trying to get it fixed again. For whatever reason, when I do fix my class declaration (which is what is returning errors) it still returns errors.. I don't have a clue why.
Again, I will definitely spend some time trying to fix this.
It's very frustrating only receiving one error when you clearly know there's at least more than 30 instances.
Freem:
This is not an error returned by C::B, but by your compiler (whatever it is).
It is not possible or hard for us to debug code with so few informations (bigger snippets and copy/paste of the log would be more helpful)... but if you used "search and replace" tool, did not you replace the name in the include directive, without having changed the filename?
Anyway, this is a a programmer error: you made an error in the code, and we can not help with so few lines.
For single error, I would like to complete oBFusCATed: solving an error often highlight other ones.
(This is why I often fix only 5-6 first errors before compiling anew ;) )
Navigation
[0] Message Index
[#] Next page
Go to full version