[vtkusers] vtk libraries, undefined references, tcl
Marcus D. Hanwell
marcus.hanwell at kitware.com
Thu Jan 23 15:24:51 EST 2014
On Thu, Jan 23, 2014 at 3:18 PM, jmerkow <jmerkow at gmail.com> wrote:
> I have a c++ program with a tcl front end. I am moving the project to CMake
> but I am having some trouble getting the VTK libraries linked properly.
>
> Most of links correctly, but the tcl parts don't seem to get properly
> linked.
>
> Here is an example:
> undefined reference to `vtkTclGetPointerFromObject(char const*, char const*,
> Tcl_Interp*, int&)'
>
> Which I believe is contained libvtkCommonCoreTCL. There are a number of
> other undef references, all related to VTK and Tcl. I checked the contents
> of vtk_libraries and libvtkCommonCoreTCL is not included. It appears that
> the vtk tcl libs aren't being included in ${VTK_LIBRARIES}. Is there an
> additional step to add these libraries in my cmake project that I'm missing?
>
Programs don't normally link to the wrapped shared objects, they are
built to be loaded and used by the language interpreter normally. I am
not sure what you are doing and why you need those symbols, but I
think that all of the libraries are exported. This means that you can
link to vtkCommonCoreTCL (the CMake target name) in addition to
${VTK_LIBRARIES}.
You might also want to ensure you are specifying the libraries you
want in the find_package(VTK) call, as that variable contains all VTK
libraries by default (so you end up linking to everything VTK built).
Hope that helps.
Marcus
More information about the vtkusers
mailing list