Q:

c++ namespace / identifier issues

I am a novice in C++ and I am encountering difficulties understanding how to handle more than 1 namespace at the same time. In my MVC application, the view needs a reference to the controller to forward the actions, while the controller needs a reference to the view to display somethings.
I have stripped out almost all from my application, and I still have a lot of compilation errors about nomespace and undeclared identifiers. This is the stripped code:
 #ifndef _geometria
#define _geometria

namespace core_stuff {

/*this namespace contains Model and Controller */

class Model {

public:
    Model();
    //void doSomething();

};

class Controller {

public:
    Controller();
    void setView(ui_stuff::View v);

};

}

namespace ui_stuff {

/*this namespace contains View and other UI classes libraries, not included here because I am semplifying the whole stuff */

class View {

public:
    View();
    void setController(core::Controller c);

};

}

#endif

and this is the implementation:
#include "geometria.h"
#include <iostream>

//implementation of core_stuff namespace  

core_stuff::Model::Model() { }

core_stuff::Controller::Controller() { }

void core_stuff::Controller::setView(ui_stuff::View v) {
//do some kind of operation in my view
}

//implementation of ui_stuff namespace*/

ui_stuff::View::View() { /* */ }

void ui_stuff::View::setController(core_stuff::Controller c) {
//do some kind of operation on the controller
}

/* main */
int main (int nArgs, char* args[]) {
core_stuff::Model m;
core_stuff::Controller c;
ui_stuff::View v;
v.setController(c);
c.setView(v);
}

The first of a very long list of compile errors involves the 
void setView(ui_stuff::View v);

line in the header file, unable to access to ui_stuff namespace:
line(20): error C2653: 'ui_stuff' is not the name of a class or a namespace
How am i supposed to fix this?

A:

You would need a forward declaration for ui_stuff::View before using it
namespace ui_stuff
{
    class View; // a forward declaration of ui_stuff::View
}

namespace core_stuff
{
   class Controller {
       void setView(ui_stuff::View& v);
   };
}

namespace ui_stuff
{
   class View
   {
   public:
        void setController(core_stuff::Controller& c);
   };
}

I've also passed it in as a reference. That's probably what you want (not a copy of the view).
A short explanation why I changed your declaration: you can't pass a View by value to a method of the Controller and pass a Controller by value to the View. This is because, when you pass by value, the whole object you pass has to be defined. You can't fully define the controller before the view because the controller depends on the complete definition of the view. But you can't define the view before the controller for the same reason, hence the "pass by reference" bit.
Once both classes are declared, you can define the way they interact with each other.

