R
rwf_20
Consider the following:
// ns.cpp
namespace ns1 {
public ref class c1 {
};
namespace ns2 {
public ref class c2 {
};
void freeFunction() { }
}
}
I build this as an assembly with cl /clr /c ns.cpp && link /DLL /
out:ns.dll ns.obj
Using the following client code, it appears I am unable to call
ns1::ns2::freeFunction().
// nsTest.cpp
#using "ns.dll"
int main() {
ns1::c1 t; // Fine
ns1::ns2::c2 c; // Fine
ns1::ns2::freeFunction(); // error C2039: 'freeFunction' is not a
member of 'ns1::ns2'
}
What's the problem here? Is this a basic restriction of the managed
world that I'm unaware of?
Thanks in advance,
Ryan
// ns.cpp
namespace ns1 {
public ref class c1 {
};
namespace ns2 {
public ref class c2 {
};
void freeFunction() { }
}
}
I build this as an assembly with cl /clr /c ns.cpp && link /DLL /
out:ns.dll ns.obj
Using the following client code, it appears I am unable to call
ns1::ns2::freeFunction().
// nsTest.cpp
#using "ns.dll"
int main() {
ns1::c1 t; // Fine
ns1::ns2::c2 c; // Fine
ns1::ns2::freeFunction(); // error C2039: 'freeFunction' is not a
member of 'ns1::ns2'
}
What's the problem here? Is this a basic restriction of the managed
world that I'm unaware of?
Thanks in advance,
Ryan