Q
quortex
Hey all,
I have been working on a project which consists of Native C++ code and
managed C# code. In order for the managed C# code to be able to access
the native layer I wrap some objects using Managed C++ Mixed Mode.
I also unit test the Native C++ code using Managed C++ using the VSTS
test tools.
Everything works fine apart from one niggly problem. With the mixed
mode libraries (Dlls) I have to put all of my implementation code into
the *header* otherwise I run into problems linking.
Then when I go to unit test using managed C++ if I use the normal
header and cpp combination everything compiles ok but when it links I
receive unresolved external token error messages.
I include the header files and add the managed references and include
the native static libraries that I am using so all should be well. I
have also tried the #using directive rather than adding references into
visual studio.
I cannot see what else I can do. If I inspect the outputted assembly
the types are definitely present so the linker shouldn't have a problem
binding to them.
So at the moment I still reference the managed c++ dll and include the
required headers as usual. But since I put all my implementation in the
headers the dll isn't really required - what I really want to do is put
my implementation code in the c++ files and then the linker should pick
the compiled managed c++ code from the assembly.
Does anyone have any ideas? This is really annoying. I can keep going
like this but it's not really ideal.
Hope that lot made sense!
Kind Regards,
Mark
I have been working on a project which consists of Native C++ code and
managed C# code. In order for the managed C# code to be able to access
the native layer I wrap some objects using Managed C++ Mixed Mode.
I also unit test the Native C++ code using Managed C++ using the VSTS
test tools.
Everything works fine apart from one niggly problem. With the mixed
mode libraries (Dlls) I have to put all of my implementation code into
the *header* otherwise I run into problems linking.
Then when I go to unit test using managed C++ if I use the normal
header and cpp combination everything compiles ok but when it links I
receive unresolved external token error messages.
I include the header files and add the managed references and include
the native static libraries that I am using so all should be well. I
have also tried the #using directive rather than adding references into
visual studio.
I cannot see what else I can do. If I inspect the outputted assembly
the types are definitely present so the linker shouldn't have a problem
binding to them.
So at the moment I still reference the managed c++ dll and include the
required headers as usual. But since I put all my implementation in the
headers the dll isn't really required - what I really want to do is put
my implementation code in the c++ files and then the linker should pick
the compiled managed c++ code from the assembly.
Does anyone have any ideas? This is really annoying. I can keep going
like this but it's not really ideal.
Hope that lot made sense!
Kind Regards,
Mark