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:
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asd'|
||=== Build finished: 1 errors, 0 warnings ===|
this is the code that the wizard generates:
file asd.h
#ifndef ASD_H
#define ASD_H
class asd
{
public:
asd();
virtual ~asd();
protected:
private:
};
#endif // ASD_H
file asd.cpp
#include "asd.h"
asd::asd()
{
//ctor
}
asd::~asd()
{
//dtor
}
...and this is the code of the project's main file:
#include "asd.h"
int main(void)
{
return 0;
}
why i'm getting this error!? thank you all in advance!
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.
GNU GCC Compiler
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?
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... :(
Quote from: stahta01 on December 14, 2010, 08:02:45 PM
Please read and follow
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
gcc --version will give you the version of the compiler
problem solved! i was using a C src and should be using a C++ src. changed filename to a CPP extension and worked fine.
thanks anyway!