User forums > Using Code::Blocks
Classes implementation?
ehguacho:
hi everyone! i've got some problems while implementing classes in Code::Blocks.
i'm trying to create a new class, but when the wizard creates the class i always get this error while running the project:
--- Code: ---error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asd'|
||=== Build finished: 1 errors, 0 warnings ===|
--- End code ---
this is the code that the wizard generates:
file asd.h
--- Code: ---#ifndef ASD_H
#define ASD_H
class asd
{
public:
asd();
virtual ~asd();
protected:
private:
};
#endif // ASD_H
--- End code ---
file asd.cpp
--- Code: ---#include "asd.h"
asd::asd()
{
//ctor
}
asd::~asd()
{
//dtor
}
--- End code ---
...and this is the code of the project's main file:
--- Code: ---#include "asd.h"
int main(void)
{
return 0;
}
--- End code ---
why i'm getting this error!? thank you all in advance!
stahta01:
And, the compiler you are using is ???
Please read and follow
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
Tim S.
ehguacho:
GNU GCC Compiler
Greatwolf:
I've tested your code above using gcc 4.4.1 and it works just fine for me. What version of gcc are you using? What's the full commandline being passed by C::B?
ehguacho:
sorry, but i don't know what version of GCC i'm using. how to do it?
and sorry again, but what do you mean with "the command line passed by C::B"?
i've tried to download and install MinGW separately of C::B and set to compiler's path to the downloaded MinGW, and nothing... :(
Navigation
[0] Message Index
[#] Next page
Go to full version