-1

I've been struggling with upgrading this solution. It has both managed and unmanaged memory and includes calls to methods that Marshal the string variables. The linking errors I get are in pairs.

LNK2028 unresolved token void __cdecl function(wchar_t const *, wchar_t const * *) referenced in function public: void __clrcall NamespaceOfTheSolutionIAmWorkingOn::function(class System::String ^, cli::array ^)

and

LNK2019 unresolved external symbol void __cdecl function(wchar_t const *, wchar_t const * *) referenced in function public: void __clrcall NamespaceOfTheSolutionIAmWorkingOn::function(class System::String ^, cli::array ^)

I've obviously modified the error messages a bit to make them more readable, the real function has a long name and passes several ints as well.

Any help would be greatly appreciated!

Bob F.
  • 1
  • 1
  • Just a postscript, when I change to the compiler option Whole Program Optimization - Yes(/GL), I get a single error LNK2001 unresolved external symbol "void __cdecl function(wchar_t *, wchar_t * *) – Bob F. Nov 21 '13 at 14:17

1 Answers1

0

Well, I just found somebody at work who helped me through the solution. The key is wchar_t. Apparently, it was not a native type in VS2003, but we had code that identified it as an array of unsigned short ints. When linking it, there was a mismatch between wchar_t and unsigned short. So I had to turn OFF the option that treated wchar_t as a native type. Now it compiles and links. I'm going to have to probably tweak it a bit more to make sure it works as we intend.

Bob F.
  • 1
  • 1