Linker error for .ctor and Finalize in managed classes 
Author Message
 Linker error for .ctor and Finalize in managed classes

Hi,

I'm new to managed C++. Currently I'm writing a DLL using
managed and unmanaged VC code together.
All my new managed classes create two link errors e.g.

LINK: error LNK2020:unresolved token (06000958)
udms.Datapool.DPParamRAW::.ctor

LINK: error LNK2020:unresolved token (06000958)
udms.Datapool.DPParamRAW::Finalize

Code of class:

#pragma once
#include "stdafx.h"

using namespace System;
using System::String;
#include "datapoolparam.cpp"

namespace udms {
namespace Datapool {

__gc public class DPParamRAW :
        public DatapoolParam
{
public:
        DPParamRAW(void);
        ~DPParamRAW(void);

Quote:
};
}; // end namespace Datapool
}; // end namespace udms

Anyone a good idea how to solve that?

Thanks

Christof



Sun, 05 Jun 2005 16:06:49 GMT  
 Linker error for .ctor and Finalize in managed classes

Quote:
> Hi,

> I'm new to managed C++. Currently I'm writing a DLL using
> managed and unmanaged VC code together.
> All my new managed classes create two link errors e.g.

> LINK: error LNK2020:unresolved token (06000958)
> udms.Datapool.DPParamRAW::.ctor

> LINK: error LNK2020:unresolved token (06000958)
> udms.Datapool.DPParamRAW::Finalize

> Code of class:

> #pragma once
> #include "stdafx.h"

> using namespace System;
> using System::String;
> #include "datapoolparam.cpp"

> namespace udms {
> namespace Datapool {

> __gc public class DPParamRAW :
> public DatapoolParam
> {
> public:
> DPParamRAW(void);
> ~DPParamRAW(void);
> };

> }; // end namespace Datapool
> }; // end namespace udms

> Anyone a good idea how to solve that?

> Thanks

> Christof

The code above is missing definitions for DPParamRAW (.ctor) and ~DPParamRAW
(Finalize).   If this is your entire code for the class, you need to
implement them or remove the declarations.  If you have definitions
elsewhere, they are not being linked into the application and you'll need to
add the relevant file(s) to the project.
--
Julian Burger
Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.


Mon, 06 Jun 2005 02:31:36 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Class.Finalize Vs. ~Class

2. Class ctor for class with Main method

3. Linker error when inheriting a templatized class

4. HELP! Linker error with template class functions

5. Linker error with class

6. Linker error with matrix template class

7. template classes, linker errors

8. linker error with SDI application view class exported from the DLL

9. Linker error with imported class

10. Linker error with template class: No constructor/destructor

11. Trying to include classes from .dll, getting linker error with CRuntimeClass

12. Linker error with matrix template class

 

 
Powered by phpBB® Forum Software