[vtkusers] Undefined Reference vtk 5.0.4 (c++)

Christian Dernehl christian.dernehl at rwth-aachen.de
Tue Mar 11 17:57:13 EDT 2008


Hi everyone,


I tried to install VTK on WinXP and on Unix, on both platforms it just 
installs fine, but if I try to use the libs, especially the constructor 
::New() I get a "undefined reference error".

So here's what I did on Windows (Windows XP 32-bit Edition Prof. with 
AMD 64, 1024 MB RAM)


Download CMake
Download VTK 5.0.4 Source

The System already had

MS VC++ 2005 Express
Platform SDK

installed.

I followed the instructions from MS on how to setup the Platform SDK.
(see http://msdn2.microsoft.com/en-us/express/aa700755.aspx)

Then I used CMake to prepare for building in VC++ 2005.
My Options for CMake on Windows were:

Java Support ON
Parallel ON
Shared ON

everything else I left default.

I build the projects and the build the INSTALL to install VTK. I also 
referenced the VTK include, bin and lib directories to VC++ (Optionsmenu)

Then I added a new VC Project and tried in the int main the following line:

vtkSphereSource *p;

That compiled without any errors; everything worked fine. But

vtkSphereSource *p = vtkSphereSource::New();

won't work at all. Here I get a undefined reference error.


So here what I did under Ubuntu:

Downloaded & installed the CMake package with $sudo apt-get install cmake


Downloaded VTK Source

runned cmake on the directory and created UNIX make files.
On Linux I tried

SHARED LIBS ON/OFF (I tried twice, both won't work)
everything else I left default

called $make
and $install

everything worked fine again.
On Linux I use CodeBlocks IDE and here I also added all path I could 
think of:

/usr/lib
/usr/include
/usr/lib/vtk-5.0
/usr/include/vtk-5.0

(yes think also most of them don't make really sense, but since I hadn't 
any idea how to solve the problem I tried to add these paths just to 
make sure that everything is referenced correctly)

Still I get the same error as on Windows: "undefined reference"

vtkSphereSource *p = vtkSphereSource::New();

or

vtkActor::New();

all these constructors won't work.

So currently I'm running out of ideas what to try;

So I'd be glad if anyone could give me a hint.

Thanks in advance!


Christian Dernehl









More information about the vtkusers mailing list