[CW6.1] CPP Compiler

cancel
Showing results for 
Search instead for 
Did you mean: 

[CW6.1] CPP Compiler

4,422 Views
Contributor I
Anyone,
 
Does the CPP compiler work???
 
1) Create a CPP Stationary for the 5213
2) Create a file Test.h
 
#ifndef __TEST_H__
#define __TEST_H__
class Test
{
public:
 Test();
private:
 int nX;
public:
 SetX(int x);
};
#endif
3) Create a file Test.cpp

#include "Test.h"
Test::smileyfrustrated:etX(int x)
{
 nX = x;
}
4) Compile.
 
I get error
 
Error   : undefined identifier 'class'
Test.h line 4   class Test
 
I have checked the force CPP compile to no avail.
 
I have attached the "Installed Plugins.txt" for reference to the version of compiler that I have.
 
Any help would be appreciated.
 
Thanks
 
Labels (1)
0 Kudos
4 Replies

61 Views
Specialist III

Hello

Just a side note.
C++ compiler cannot be used with Coldfire Special or Standard Edition. If you wish to build C++ code, you have to upgrade to a professional edition.

CrasyCat

0 Kudos

61 Views
Contributor I
Thanks CrasyCat.  Will do.
0 Kudos

61 Views
Contributor V
I can't reproduce the exact error you get, but your snippet compiles without error if you give the SetX() method a return type (as required by ISO C++):
 
#ifndef __TEST_H__
#define __TEST_H__
class Test
{
public:
 Test();
private:
 int nX;
public:
 void SetX(int x);
};
#endif
Marc.
0 Kudos

61 Views
Contributor I

Marc,

Thanks for looking into this for me.  I think the problem is with the licensing.  I had requested the registration and received the reply email with the registration code.  I had previously entered the code but it appears that the final step did not get past our in-house firewall or something.

I have requested more information from the licensing team.  Hopefully this will help.

Best Regards,

Mark

P.S.  Glad you noticed my error.  :smileyhappy:  I did add void with to no avail.  I added a #ifdef __cplusplus and it completely skips the code, another sign that the compiler is not compiling in CPP mode.  I also added #pragma cplusplus on again to no avail.

0 Kudos