Hello,
which spezifications / header files are necessary to use the Realview compiler for c++?
I use
#include<stdlib.h> #include<iostream.h>
Class Array { private: int val[19]; public: int max = 2; };
But µVision don't know the word "Class" - is it the wrong spelling or is there a necessary headerfile missing?
best wishes Tina
2 possible solutions:
a) use files with .cpp extension - this automatically enables the C++ language.
b) when using files with extension .c, then the --cpp command needs to be added to -
Options for Target - C/C++ - Misc Controls.
This will enable C++ for .c files, otherwise C90 is used by default.
thanks - that's seems to be the right way. Is it enough to add -cpp in the misc controls?
best regards Tina
ok it works - thanks for your help
"that's seems to be the right way"
I don't think so!
The "right" way, in my opinion, is to use the .cpp filetype to identify C++ files, and .c to identify pure 'C' files. (or, at least, to choose some other distinct, well-defined classification)
This is the way the tools expect it, the most obvious way, and the generally-accepted way.
It is also my experience that deliberately fighting against the tools, the obvious way, and general practice will cause you pain and grief in the future...
To repeat myself (from an earlier post):
I'm not sitting near the tools, but even if it is possible to have c++ code in a *.c file, I don't recommend it. Always use the proper file extension.
in my project, I only want to use C++ and not C.
I was only searching for a possibility to see that c++ is working with uvision. that's all