[vtkusers] building MATLAB MEX files with vtk 6.1?
David Gobbi
david.gobbi at gmail.com
Wed Aug 6 16:14:37 EDT 2014
Hi Bernard,
As you have rightly guessed, the libraries vtkCommon, vtkRendering,
etc. no longer exist in VTK 6. The minimal set of libraries that you
need for VTK 6 are probably the following:
vtkCommonCore
vtkCommonDataModel
vtkRenderingCore
vtkRenderingOpenGL
vtkRenderingFreeTypeOpenGL
vtkInteractionStyle
- David
On Wed, Aug 6, 2014 at 11:13 AM, Meehan, Bernard <MEEHANBT at nv.doe.gov> wrote:
> I've tried to get a couple of tutorials built using CMake and haven't had a
> whole lot of luck ...
>
> http://www.cmake.org/Wiki/CMake/MatlabMex
> http://www.mathworks.com/matlabcentral/fileexchange/19638-visualization-toolkit--vtk--mex-interface
> http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html
>
> I figured that I might try to do it by hand so to speak - just to prove to
> myself that I could get it to work. I used this as a test file (does nothing
> on purpose):
> #include "mex.h"
>
> #include <vtkSmartPointer.h>
> #include <vtkSphereSource.h>
> #define VTK_CREATE(type, name) \
> vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
>
> void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
> {
> mexPrintf("Hi there!\n");
> VTK_CREATE(vtkSphereSource, source);
> }
>
> And I tried to compile it with:
> #!/bin/sh
> MEX=/Applications/MATLAB_R2013b.app/bin/mex
> $MEX -I/Users/meehanbt/VTK/include/vtk-6.1/ hello.cxx
> -L/Users/meehanbt/VTK/lib/ -lvtkCommon -lvtkRendering
>
> Obviously, for VTK 6.1 - the libraries are much more finely grained ... and
> I just did a copy/paste from a webpage somewhere. Trying to build the simple
> program gives:
> ld: library not found for -lvtkCommon
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
> mex: link of ' "hello.mexmaci64"' failed.
>
> Does anyone have any advice for how I would go about making a simple data
> display window or something like that as a MEX file?
More information about the vtkusers
mailing list