[vtkusers] Linker error in managed C++

Oliver Moss o.moss at eprosoft.de
Mon May 26 15:51:17 EDT 2003


Hello Guys,

I have invested a lot of hours in finding an error in the following code.
Maybe, someone has an idea what could be wrong....

The environment:
Visual Studio.NET 2003, managed C++ and unmanged libs (the vtkLibrary
4.2.2).
I added the libs and include the path to header files both in the same way.

This sample does nothing, but it could be compiled and linked well (Win32
Console, not managed):

#include "stdafx.h"
#include "vtkPolyData.h"
int _tmain(int argc, _TCHAR* argv[])
{
    vtkPolyData *profile = vtkPolyData :: New ();
    return 0;
}

And this sample produces a linker error (.NET Assembly):
#pragma once
#using <mscorlib.dll>
using namespace System::Runtime::InteropServices;
using namespace System;
namespace PowerCrust
{
    public __gc class TriPointPowerCrust
    {
        // TODO: Add your methods for this class here.
        public:
        bool DoPowerCrust(void)
        {
            vtkPolyData *profile = vtkPolyData :: New ();
            return true;
        }
    };
}

This is the error I get:

Linking...
LINK : error LNK2020: unresolved token (0A000013) _CxxThrowException LINK :
error LNK2020: unresolved token (0A000024) delete LINK : fatal error
LNK1120: 2 unresolved externals

Any idea?

Thank you very much,

Oliver





More information about the vtkusers mailing list