简体   繁体   中英

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 - ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM