Refering a header file of unmanaged project in managed project

  • Thread starter Thread starter Sarwan
  • Start date Start date
S

Sarwan

Hello everybody

I have a solution in which there is an unmanaged MFC application. Then
i added a new managed .Net Windows Form application. I was trying to
refer an header file of unmanaged project into the my managed project.
But it leads to link error.

Form1.obj : error LNK2001: unresolved external symbol "public: void
__thiscall FormViewer::CFormViewer::StartViewer(void)" (?
StartViewer@CFormViewer@FormViewer@@$$FQAEXXZ)

The class which we refered in managed will refer other classes.

First of all such refering to other project is allowed.

Thanking you
 
Sarwan said:
Hello everybody

I have a solution in which there is an unmanaged MFC application. Then
i added a new managed .Net Windows Form application. I was trying to
refer an header file of unmanaged project into the my managed project.
But it leads to link error.

Form1.obj : error LNK2001: unresolved external symbol "public: void
__thiscall FormViewer::CFormViewer::StartViewer(void)" (?
StartViewer@CFormViewer@FormViewer@@$$FQAEXXZ)

Did you link with the library file from the unmanaged project, where the
functions are (which are in .cpp files, not the header file)

Possibly you used a #include for a C++ class from inside a namespace... that
won't work. Unless you use extern "C", your fully qualified class names
must exactly match the ones used by the library, including namespace,
because the compiler decorated name contains the namespace.
 
Back
Top