Error C2653 Is Not A Class Name
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About error c2653 'system' is not a class or namespace name Us Learn more about Stack Overflow the company Business Learn more about hiring error c2653 'std' is not a class or namespace name developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the
Error C2653 'boost' Is Not A Class Or Namespace Name
Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Compiler error C2653: not a
Error C2653 C++
class or namespace name up vote 7 down vote favorite 2 So I have been having this extremely frustrating problem lately with Visual C++ 2012. Up until a few hours ago, I was writing code just fine and everything was working as intended, until I decided to optimize some things and deleted a few classes. I fixed all of the errors that were popping up because error c2653 visual c++ of that, e.g. false includes, etc. Unfortunately, after this the VS compiler went crazy. It started giving me errors such as: Error 14 error C2653: 'Class' : is not a class or namespace name or even Error 5 error C2143: syntax error : missing ';' before '}' Error 4 error C2059: syntax error : '>' I've checked multiple times, and everything is in it's right place: all headers included, all symbols placed where they should be. As far as I understand, the problem is not with my code but with the compiler itself... Visual Studio can be really annoying at times, I guess. Anyway, I would really be grateful if someone could help me out on this one. (By the way, disabling precompiled headers did not work) Relevant parts of code: Error 14: #include "PlayerEntity.h" PlayerEntity::PlayerEntity(void) {} // This line causes the error Error 5: class GameScreen : public BaseScreen { public: ... private: ... }; // This line causes the error Error 4: private: std::vector
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company
Is Not A Class Or Namespace Enum
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs is not a class or namespace c++ Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just system is not a class or namespace name like you, helping each other. Join them; it only takes a minute: Sign up “error C2653: System is not a class or a namespace name” in Form header file, Visual C++ up vote 3 down vote favorite http://stackoverflow.com/questions/15740952/compiler-error-c2653-not-a-class-or-namespace-name 1 My previous questions concerning the same project: one and two. It's not necessary to read them; just know that I am trying to use a native C++ SDK in a Visual C++ project. This is much trickier than I had initially thought, but this website about Extending a native C++ project with managed code has helped me a lot further already. As per that last link's instructions, I have added a Form to http://stackoverflow.com/questions/15763179/error-c2653-system-is-not-a-class-or-a-namespace-name-in-form-header-file-vi my native C++ project, which has automatically converted the project to a CLR one. Only MainForm.cpp and Interface.cpp (the file that allows native C++ code to create and show a MainForm) are compiled with the /clr flag though; the other files remain native. The problem I have now, is that Visual Studio doesn't seem to recognise any of the CLR stuff that's being used in MainForm.h. As such, in the following lines: using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; the word System is always underlined in red, with according errors: error C2653: 'System' is not a class or a namespace name for each of those lines. It also does not recognise the word gcnew and other things that should work effortlessly inside CLR. Can anybody tell me what I might be doing wrong? My guess is that it's something very small; some flag I have forgotten to change, a missing reference or something similar, but I just can't figure out what it is. c++ visual-studio-2010 visual-c++ share|improve this question asked Apr 2 '13 at 11:40 Lee White 1,53031435 1 Where do you include MainForm.h? If you include it in any translation unit (i.e. *.cpp) that is not compiled with /clr, then the compiler will of course complain about it, b
resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9 Documentation APIs and reference https://msdn.microsoft.com/en-us/library/a4867f7c.aspx Dev centers Retired content Samples We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. C/C++ Building Reference C/C++ Build Errors Compiler Errors C2600 Through http://www.cplusplus.com/forum/beginner/39760/ C2699 Compiler Errors C2600 Through C2699 Compiler Error C2653 Compiler Error C2653 Compiler Error C2653 Compiler Error C2600 Compiler Error C2601 Compiler Error C2602 Compiler Error C2603 Compiler Error C2605 is not Compiler Error C2611 Compiler Error C2612 Compiler Error C2613 Compiler Error C2614 Compiler Error C2616 Compiler Error C2617 Compiler Error C2619 Compiler Error C2624 Compiler Error C2626 Compiler Error C2627 Compiler Error C2628 Compiler Error C2630 Compiler Error C2632 Compiler Error C2633 Compiler Error C2634 Compiler Error C2635 Compiler Error C2636 Compiler Error C2637 Compiler Error C2638 Compiler Error C2640 Compiler Error is not a C2645 Compiler Error C2646 Compiler Error C2647 Compiler Error C2648 Compiler Error C2649 Compiler Error C2650 Compiler Error C2651 Compiler Error C2652 Compiler Error C2653 Compiler Error C2654 Compiler Error C2655 Compiler Error C2656 Compiler Error C2657 Compiler Error C2658 Compiler Error C2659 Compiler Error C2660 Compiler Error C2661 Compiler Error C2662 Compiler Error C2663 Compiler Error C2664 Compiler Error C2665 Compiler Error C2666 Compiler Error C2667 Compiler Error C2668 Compiler Error C2669 Compiler Error C2670 Compiler Error C2671 Compiler Error C2673 Compiler Error C2674 Compiler Error C2675 Compiler Error C2676 Compiler Error C2677 Compiler Error C2678 Compiler Error C2679 Compiler Error C2680 Compiler Error C2681 Compiler Error C2682 Compiler Error C2683 Compiler Error C2687 Compiler Error C2688 Compiler Error C2689 Compiler Error C2690 Compiler Error C2691 Compiler Error C2692 Compiler Error C2693 Compiler Error C2694 Compiler Error C2695 Compiler Error C2696 Compiler Error C2698 TOC Collapse the table of content Expand the table of content This documentation is archived and is not being maintained. This documentation is archived and is not being maintained. Compiler Error C2653 Visual Studio 2015 Other Versions Visual Studio
to use it. The offending code can be simplified as far as the below, there is no reason in standard C++ that this would not work, therefore I cannot see the issue. 1
2
3
4
5
6
7
class Test { public: static int yo; }; int Test::yo = 1; Compiler messages: dllmain.cpp(4): error C3872: '0x2028': this character is not allowed in an identifier 1>dllmain.cpp(4): error C3872: '0x2028': this character is not allowed in an identifier 1>dllmain.cpp(4): error C3872: '0x2028': this character is not allowed in an identifier 1>dllmain.cpp(4): error C2065: ' ' : undeclared identifier 1>dllmain.cpp(4): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>dllmain.cpp(4): error C2144: syntax error : 'int' should be preceded by ';' 1>dllmain.cpp(4): error C3872: '0x2028': this character is not allowed in an identifier 1>dllmain.cpp(4): error C2143: syntax error : missing ';' before '}' 1>dllmain.cpp(4): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>dllmain.cpp(4): error C3872: '0x2028': this character is not allowed in an identifier 1>dllmain.cpp(5): error C2144: syntax error : 'int' should be preceded by ';' 1>dllmain.cpp(5): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>dllmain.cpp(5): error C2653: 'Test' : is not a class or namespace name Notice the "this character is not allowed in an identifier", could it be the encoding of the file, or is the last error message the cause, incorrect syntax? I'm baffled why this simple piece of code will not work in Visual Studio. Thanks. =\ Mar 31, 2011 at 8:45pm UTC Mathhead200 (1008) KrisandoNotice the "this character is not allowed in an identifier", could it be the encoding of the file That's what I was thinking too. Maybe try to copy the code to a raw text editor (like notepad) and back. Or better yet, just edit the files from there. Also this code has a main function right? Last edited on Mar 31, 2011 at 8:47pm UTC Mar 31, 2011 at 8:45pm UTC filipe (1165) int Test::yo = 1; Mar 31, 2011 at 8:54pm UTC Krisando (120) Thanks for your opinion Mathhead200, since you agreed it could be the encoding I tried Unix encoding and not only did it work, it displayed