Chucker
2005-10-31 14:57:04 UTC
Hi Folks,
I am just trying to port my Application from .NET 1.1 to 2.0.
Native C++ Code works fine.
Native C# Code also works fine (just some deprecations).
The problems start when trying to port my managed C++ Wrappers.
In .NET 1.1 with a lot of reading (mostly newsgroups like this) I managed to
create managed C++ DLL`s wrapping my native libs. The key problems where
these:
(In Linker settings)
1.) Additional Dependencies: mscoree.lib msvcrt.lib (or msvcrtd.lib for
debug version) mystaticlib.lib
2.) Ignore Specific Library: nochkclr.obj
3.) Force Symbol Reference: ***@12
This works fine and I would like to port this to the new CLR.
In Visual Studio 2005 i.e. .NET 2.0 I get the following Linker errors:
1>------ Build started: Project: empDll, Configuration: Debug Win32 ------
1>Linking...
1>Parameter.obj : error LNK2028: unresolved token (0A000007) "extern "C"
void __clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??***@std@@$$***@XZ)
1>Imagic.obj : error LNK2028: unresolved token (0A000007) "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
__thiscall std::bad_alloc::bad_alloc(char const *)"
(??***@std@@$$***@PBD@Z)
1>Align2D.obj : error LNK2028: unresolved token (0A000008) "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??***@std@@$$***@XZ)
1>Parameter.obj : error LNK2028: unresolved token (0A000347) "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::logic_error::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Imagic.obj : error LNK2028: unresolved token (0A0003D3) "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::bad_alloc::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Align2D.obj : error LNK2028: unresolved token (0A000358) "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::logic_error::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Align2D.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)
1>AssemblyInfo.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)
1>Imagic.obj : error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"
(?.cctor@@$$FYMXXZ)
1>Parameter.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)
1>Align2D.obj : error LNK2019: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??***@std@@$$***@XZ)
1>Imagic.obj : error LNK2001: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z)
1>Parameter.obj : error LNK2001: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z)
1>Align2D.obj : error LNK2019: unresolved external symbol "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::logic_error::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Imagic.obj : error LNK2001: unresolved external symbol "void __clrcall `eh
vector destructor iterator'(void *,unsigned int,int,void (__clrcall*)(void
*))" (??_M@$$***@Z@Z)
1>Parameter.obj : error LNK2001: unresolved external symbol "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z)
1>Debug\empDll.dll : fatal error LNK1120: 9 unresolved externals
1>Build log was saved at "file://d:\Visual Studio Projects
2.0\empDll\empDll\Debug\BuildLog.htm"
1>empDll - 17 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
or
1>------ Build started: Project: empDll, Configuration: Release Win32 ------
1>Linking...
1>Parameter.obj : error LNK2028: unresolved token (0A000006) "extern "C"
void __clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??***@std@@$$***@XZ)
1>Imagic.obj : error LNK2028: unresolved token (0A000006) "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "extern
"C" float __cdecl cosf(float)" (?cosf@@$$***@Z)
1>Align2D.obj : error LNK2028: unresolved token (0A000007) "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??***@std@@$$***@XZ)
1>Parameter.obj : error LNK2028: unresolved token (0A0002C6) "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::logic_error::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Imagic.obj : error LNK2020: unresolved token (0A00033F) "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z)
1>Align2D.obj : error LNK2028: unresolved token (0A0002D7) "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::logic_error::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Align2D.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)
1>AssemblyInfo.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)
1>Imagic.obj : error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"
(?.cctor@@$$FYMXXZ)
1>Parameter.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)
1>Align2D.obj : error LNK2019: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??***@std@@$$***@XZ)
1>Imagic.obj : error LNK2001: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z)
1>Parameter.obj : error LNK2001: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z)
1>Align2D.obj : error LNK2019: unresolved external symbol "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::logic_error::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Imagic.obj : error LNK2001: unresolved external symbol "void __clrcall `eh
vector destructor iterator'(void *,unsigned int,int,void (__clrcall*)(void
*))" (??_M@$$***@Z@Z)
1>Parameter.obj : error LNK2001: unresolved external symbol "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z)
1>Release\empDll.dll : fatal error LNK1120: 9 unresolved externals
1>Build log was saved at "file://d:\Visual Studio Projects
2.0\empDll\empDll\Release\BuildLog.htm"
1>empDll - 17 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Could anyone please tell me how to solve these errors or where to find
newsgroups / tutorials for .NET 2.0 Interop? The usual suspects don´t know
about these issues (yet).
Thanks in advance for your efforts
Chucker
I am just trying to port my Application from .NET 1.1 to 2.0.
Native C++ Code works fine.
Native C# Code also works fine (just some deprecations).
The problems start when trying to port my managed C++ Wrappers.
In .NET 1.1 with a lot of reading (mostly newsgroups like this) I managed to
create managed C++ DLL`s wrapping my native libs. The key problems where
these:
(In Linker settings)
1.) Additional Dependencies: mscoree.lib msvcrt.lib (or msvcrtd.lib for
debug version) mystaticlib.lib
2.) Ignore Specific Library: nochkclr.obj
3.) Force Symbol Reference: ***@12
This works fine and I would like to port this to the new CLR.
In Visual Studio 2005 i.e. .NET 2.0 I get the following Linker errors:
1>------ Build started: Project: empDll, Configuration: Debug Win32 ------
1>Linking...
1>Parameter.obj : error LNK2028: unresolved token (0A000007) "extern "C"
void __clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??***@std@@$$***@XZ)
1>Imagic.obj : error LNK2028: unresolved token (0A000007) "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
__thiscall std::bad_alloc::bad_alloc(char const *)"
(??***@std@@$$***@PBD@Z)
1>Align2D.obj : error LNK2028: unresolved token (0A000008) "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??***@std@@$$***@XZ)
1>Parameter.obj : error LNK2028: unresolved token (0A000347) "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::logic_error::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Imagic.obj : error LNK2028: unresolved token (0A0003D3) "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::bad_alloc::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Align2D.obj : error LNK2028: unresolved token (0A000358) "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::logic_error::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Align2D.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)
1>AssemblyInfo.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)
1>Imagic.obj : error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"
(?.cctor@@$$FYMXXZ)
1>Parameter.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)
1>Align2D.obj : error LNK2019: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??***@std@@$$***@XZ)
1>Imagic.obj : error LNK2001: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z)
1>Parameter.obj : error LNK2001: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z)
1>Align2D.obj : error LNK2019: unresolved external symbol "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::logic_error::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Imagic.obj : error LNK2001: unresolved external symbol "void __clrcall `eh
vector destructor iterator'(void *,unsigned int,int,void (__clrcall*)(void
*))" (??_M@$$***@Z@Z)
1>Parameter.obj : error LNK2001: unresolved external symbol "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z)
1>Debug\empDll.dll : fatal error LNK1120: 9 unresolved externals
1>Build log was saved at "file://d:\Visual Studio Projects
2.0\empDll\empDll\Debug\BuildLog.htm"
1>empDll - 17 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
or
1>------ Build started: Project: empDll, Configuration: Release Win32 ------
1>Linking...
1>Parameter.obj : error LNK2028: unresolved token (0A000006) "extern "C"
void __clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??***@std@@$$***@XZ)
1>Imagic.obj : error LNK2028: unresolved token (0A000006) "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "extern
"C" float __cdecl cosf(float)" (?cosf@@$$***@Z)
1>Align2D.obj : error LNK2028: unresolved token (0A000007) "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??***@std@@$$***@XZ)
1>Parameter.obj : error LNK2028: unresolved token (0A0002C6) "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::logic_error::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Imagic.obj : error LNK2020: unresolved token (0A00033F) "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z)
1>Align2D.obj : error LNK2028: unresolved token (0A0002D7) "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::logic_error::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Align2D.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)
1>AssemblyInfo.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)
1>Imagic.obj : error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"
(?.cctor@@$$FYMXXZ)
1>Parameter.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)
1>Align2D.obj : error LNK2019: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??***@std@@$$***@XZ)
1>Imagic.obj : error LNK2001: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z)
1>Parameter.obj : error LNK2001: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$***@Z0@Z)
1>Align2D.obj : error LNK2019: unresolved external symbol "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z) referenced in function
"public: virtual void * __thiscall std::logic_error::`vector deleting
destructor'(unsigned int)" (??***@std@@$$***@Z)
1>Imagic.obj : error LNK2001: unresolved external symbol "void __clrcall `eh
vector destructor iterator'(void *,unsigned int,int,void (__clrcall*)(void
*))" (??_M@$$***@Z@Z)
1>Parameter.obj : error LNK2001: unresolved external symbol "void __clrcall
`eh vector destructor iterator'(void *,unsigned int,int,void
(__clrcall*)(void *))" (??_M@$$***@Z@Z)
1>Release\empDll.dll : fatal error LNK1120: 9 unresolved externals
1>Build log was saved at "file://d:\Visual Studio Projects
2.0\empDll\empDll\Release\BuildLog.htm"
1>empDll - 17 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Could anyone please tell me how to solve these errors or where to find
newsgroups / tutorials for .NET 2.0 Interop? The usual suspects don´t know
about these issues (yet).
Thanks in advance for your efforts
Chucker