Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    C++ So odd problem with connection from Form1 "is not namespace name... "

    Hi !!!

    I have so strange problem... i dont know what i have to do..

    Quote from form1.h :

    #pragma once
    #include "Center.h"
    #include <time.h>
    #include <windows.h>


    namespace RCK {

    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System:ata;
    using namespace System:rawing;

    /// <summary>
    /// Summary for Form1
    ///
    /// WARNING: If you change the name of this class, you will need to change the
    /// 'Resource File Name' property for the managed resource compiler tool
    /// associated with all .resx files this class depends on. Otherwise,
    /// the designers will not be able to interact properly with localized
    /// resources associated with this form.
    /// </summary>
    public ref class Form1 : public System::Windows::Forms::Form
    {
    public:
    Form1(void)
    {
    InitializeComponent();
    CCenter^ Engine;
    Engine = gcnew CCenter(this);
    //
    //TODO: Add the constructor code here
    //
    }
    ....

    Center.h

    #pragma once
    #include "StandsQue.h"
    #include "Giver.h"
    #include "StandsQue.h"
    #include "Form1.h"

    public ref class CCenter
    {
    public:
    CCenter();
    ~CCenter(void);
    void AddGiver(void);
    void Work(void);
    void AddStand(System::Int32 StandsNumber);
    private:
    RCK::Form1 Interfejs;
    };



    And compiler saying to me :P

    1>d:\moje dokumenty\visual studio 2008\projects\rck\rck\Center.h(16) : error C2653: 'RCK' : is not a class or namespace name

    Someone know what is this ?? Please...

  • #2
    Regular Coder
    Join Date
    May 2004
    Location
    New Hampshire, America
    Posts
    246
    Thanks
    0
    Thanked 2 Times in 2 Posts
    It's because you define the namespace RCK in a header file AFTER you included Center.h. It should be the other way around.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •