<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Georgia, sans-serif; ">
<div>I've tried to get a couple of tutorials built using CMake and haven't had a whole lot of luck ...</div>
<div><br>
</div>
<div><a href="http://www.cmake.org/Wiki/CMake/MatlabMex">http://www.cmake.org/Wiki/CMake/MatlabMex</a></div>
<div><a href="http://www.mathworks.com/matlabcentral/fileexchange/19638-visualization-toolkit--vtk--mex-interface">http://www.mathworks.com/matlabcentral/fileexchange/19638-visualization-toolkit--vtk--mex-interface</a></div>
<div><a href="http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html">http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html</a></div>
<div><br>
</div>
<div>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):</div>
<div>
<div>#include "mex.h"</div>
<div><br>
</div>
<div>#include <vtkSmartPointer.h></div>
<div>#include <vtkSphereSource.h></div>
<div>#define VTK_CREATE(type, name) \</div>
<div>  vtkSmartPointer<type> name = vtkSmartPointer<type>::New()</div>
<div><br>
</div>
<div>void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {</div>
<div>  mexPrintf("Hi there!\n");</div>
<div>  VTK_CREATE(vtkSphereSource, source);</div>
<div>}</div>
</div>
<div><br>
</div>
<div>And I tried to compile it with:</div>
<div>
<div>#!/bin/sh</div>
<div>MEX=/Applications/MATLAB_R2013b.app/bin/mex</div>
<div>$MEX -I/Users/meehanbt/VTK/include/vtk-6.1/ hello.cxx -L/Users/meehanbt/VTK/lib/ -lvtkCommon -lvtkRendering</div>
</div>
<div><br>
</div>
<div>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:</div>
<div>
<div>ld: library not found for -lvtkCommon</div>
<div>clang: error: linker command failed with exit code 1 (use -v to see invocation)</div>
<div><br>
</div>
<div>    mex: link of ' "hello.mexmaci64"' failed.</div>
</div>
<div><br>
</div>
<div>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?</div>
<div><br>
</div>
<div><br>
</div>
</body>
</html>