F# -> C++/CLI problem: The namespace or module xxx is not defined, but F# -> C# -> C++/CLI is fine
Done a lot of googling but finding little info on F# -> C++/CLI
Very simple set up, in C++/CLI
namespace A {
public ref class B{
public static void f(开发者_运维知识库){};
}; }
In a C# project the namespace is visible can call f()
fine:
A.B.f()
In an F# project the namespace is not visable and I get a compile error, and a red squiggly line under A.
If I wrap a call to f()
in C# and then call that from F# all is ok.
I have made sure the build order is right and references set up. I can't see why F# is not behaving exactly like C#. Anyone got this working? Maybe some project setting needed in F#?
It is a pain to have to introduce a C# glue layer ?!?!?!
OK it looks like a 2008 problem. A bug?
On my home PC I have downloaded VS C++ 2010 express and the 2010 shell and it works fine.
It took me a while to realise that it did not matter that I could not add my C++ project to my solution in the shell - i.e. I just needed to browse to the dll when adding a reference.
It is a bit of pain in the work environment since downloading the 2010 shell is probably not going to fly so I will have to make do with my work around of going via C# to get from F# to C++/CLI
Home is 64 bit btw.
Thanks for helping out.
精彩评论