compile c++ code in uVision3?

Hello all,
I am trying to compile c++ code in Keil uVison3. Saving a file as .cpp causes all color formatting to dissappear, and code will not compile. There is no option to save as a cpp file either, i have to do it manually. there is an option that associates cpp file as c++ source, but .c++ extensions are not found in the file extension lists when i open or save a file. (i have to select *.* when i want to see the .cpp file)

I read another post that says saving as .cpp should be all that is needed. What gives? I need to be able to write classes, and this can not be done in c.

Parents
  • I need to be able to write classes, and this can not be done in c.

    It can be done in C, it's just not as pretty. In fact, the first C++ compiler actually compiled C++ to C, and the output then had to be compiled with a C compiler.

    There are C++ compilers for the 8051 out there, for example from Ceibo, if you absolutely have to use classes, but the whole concept is something the architecture of the '51 is not really suited for. Also, the C++ compiler will actually do "Embedded C++", which is a limited subset of C++ that you may or may not be satisfied with.

Reply
  • I need to be able to write classes, and this can not be done in c.

    It can be done in C, it's just not as pretty. In fact, the first C++ compiler actually compiled C++ to C, and the output then had to be compiled with a C compiler.

    There are C++ compilers for the 8051 out there, for example from Ceibo, if you absolutely have to use classes, but the whole concept is something the architecture of the '51 is not really suited for. Also, the C++ compiler will actually do "Embedded C++", which is a limited subset of C++ that you may or may not be satisfied with.

Children
More questions in this forum