Ok, it is pretty clear that you need to link to other vtk libs as well..<br>
<br>
This line:<br>
<span class="q" id="q_10e42c27d0d2ddf2_1"><span>LIBS += C:\vtk-5.0.2\VTKBINARIES\bin\debug\vtkRendering.lib
<br>
<br>
You need to add additional libs here...<br>
<br>
For example, vtkDICOMparser lib, vtkCommon lib etc. See the list that I had and take out the libs you do not need.<br>
<br>
This can be specified in your PRO file and qmake should generate the
proper studio file for you. I do not use windows, so I do not know the
exact details there.... At least you got rid of compiling errors,
linking should just be a matter of locating the right libs.<br>
<br>
Good luck,<br>
Anja</span></span><br><br><div><span class="gmail_quote">On 13/10/06, <b class="gmail_sendername">Ashish Singh</b> <<a href="mailto:mrasingh@gmail.com">mrasingh@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Here's the log file with all the errors.<div><span class="q" id="q_10e42c27d0d2ddf2_1"><br>Thanks,<br>Ashish<br><br><div><span class="gmail_quote">On 10/13/06, <b class="gmail_sendername">Anja Ende</b> <<a href="mailto:anja.ende@googlemail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
anja.ende@googlemail.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Could you also send me the error messages that you got?<div><span>
<br><br><div><span class="gmail_quote">On 13/10/06, <b class="gmail_sendername">Ashish Singh</b> <<a href="mailto:mrasingh@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mrasingh@gmail.com
</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks Anja. I am using visual studio 2005 as my IDE. I ran a simple example. I clubbed the hello world example from qt and an image display example from vtk together and then ran it using qmake. I wanted to make a visual studio project so i ran the command:
<br>'qmake -project -t vcapp -o <a href="http://helloworld.pro" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">helloworld.pro'</a><br>this gave me a <a href="http://helloworld.pro" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
helloworld.pro</a> file. I edited this file to include the path etc and then ran qmake again. this gave me a .vcproj file which i opened in visual studio and then build it there. Here I got all those errors.
<br>The code I am using to test the working of vtk and qt together is as follows:<br>-----<br>#include <QApplication><br>#include <QPushButton><br>#include "vtkRenderWindow.h"<br>#include "vtkRenderer.h
"<br>#include "conio.h"<br>#include "vtkDICOMImageReader.h"<br>#include "vtkImageViewer2.h"<br>#include "vtkRenderWindowInteractor.h"<br><br><br> int main(int argc, char *argv[])
<br> {<br> QApplication app(argc, argv);<br><br> QPushButton hello("Hello world!");<br> hello.resize(100, 30);<br><br> hello.show();<br> // return app.exec();<br> // }<br>
<br>
<br>//int main( int argc, char *argv[] )<br>//{<br> <br> vtkDICOMImageReader *img1=vtkDICOMImageReader::New();<br> img1->SetFileName("D:\\testimages\\IM_00001.dcm");<br> <br> vtkImageViewer2 * myviewer=vtkImageViewer2::New();
<br> myviewer->SetInput(img1->GetOutput());<br> //myviewer->SetSize(720,540);<br> myviewer->SetColorWindow(2000);<br> myviewer->SetColorLevel(1500);<br> myviewer->Render();<br><br> vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New();
<br> iren->SetRenderWindow(myviewer->GetRenderWindow());<br> iren->Initialize();<br> iren->Start();<br><br> img1->Delete();<br> myviewer->Delete();<br> iren->Delete();<br> <br> return app.exec
();
<br>}<br>------<br>And my modified <a href="http://helloworld.pro" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">helloworld.pro</a> file looks like this:<br>----<br>######################################################################
<br># Automatically generated by qmake (
2.00a) Fri Oct 13 12:20:39 2006<br>######################################################################<br><br>TEMPLATE = vcapp<br>TARGET +=<br>DEPENDPATH += .<br>LIBS += C:\vtk-5.0.2\VTKBINARIES\bin\debug\vtkRendering.lib
<br>INCLUDEPATH += .;C:\vtk-5.0.2\VTKSOURCE\GRAPHICS;C:\vtk-5.0.2\VTKSOURCE\FILTERING;C:\vtk-5.0.2\VTKSOURCE\COMMON;C:\vtk-5.0.2\VTKBINARIES;C:\vtk-5.0.2\VTKSOURCE\RENDERING;C:\vtk-5.0.2\VTKSOURCE\IO<br><br><br># Input<br>
SOURCES += helloworld.cpp<br>-------<br>Am I missing something? Plz. help.<div><span><br><br>Thanks,<br>Ashish<br><br><br><div><span class="gmail_quote">On 10/13/06, <b class="gmail_sendername">
Anja Ende</b> <<a href="mailto:anja.ende@googlemail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
anja.ende@googlemail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Ashish,<br><br>LD_LIBRARY_PATH only tells where to look for the dynamic libraries (DLLs on windows). <br><br>What development environment are you using? Did you simply run qmake on your pro file and then make or are you using an IDE?
<br><br>Unfortunately, I am not a development machine now. But if it does not work, I will try to send a simple example tomorrow.<div><span><br><br>Cheers,<br>Anja<br><br><div><span class="gmail_quote">
On 13/10/06, <b class="gmail_sendername">
Ashish Singh</b> <<a href="mailto:mrasingh@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mrasingh@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks Anja. But I am still stuck. Can you send me a simple example maybe a cone example with something like a push button along with the pro file, using both vtk and qt?<br><br>As you suggested I set the lib path in the .pro file and the include path to my vtk parent directory. But now it says cannot open include file
vtkconesource.h, if I add the path to this file it comes up with another file...and another and another...<br>I get 5-6 such errors and if I include the path to all of them, I get a fatal error:363 unresolved externals.<br>
What did i miss? what is the LD_LIBRARY_PATH in your example? I didnt do that part.<div><span><br><br>Thanks,<br>Ashish<br><br><br><div><span class="gmail_quote">On 10/13/06, <b class="gmail_sendername">
Anja Ende</b> <<a href="mailto:anja.ende@googlemail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
anja.ende@googlemail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Ashish,<br><br>In the project PRO file (this is used when you run qmake) command, you will need to specify where the vt include and lib files are.
<br><br>Below, I am attaching the relevant sections from my PRO file. As you can see the LIBS directive tells QT the vtk libs I am using in my project and the INCLUDEPATH also includes the path to the vtk includes.
<br><br>LIBS += -lvtkWidgets \<br>-lQVTK \<br>-lvtktiff \<br>-lvtkjpeg \<br>-lvtkexpat \<br>-lvtkMPEG2Encode \<br>-lvtkIO \<br>-lvtkRendering \<br>-lvtkGraphics \<br>-lvtkImaging \<br>-lvtkftgl \<br>-lvtkfreetype \<br>-lvtkFiltering \
<br>-lvtkCommon \<br>-lvtksys \<br>-lvtkDICOMParser \<br>-lXt \<br>-lvtkpng \<br>-lvtkzlib<br><br>INCLUDEPATH += ../src \<br>/usr/local/include/vtk-5.0<br><br>In addition you must export the QTDIR and PATH variables and set the
LD_LIBRARY_PATH . In Linux, the best place is the .bashrc file. I am
not sure about windows but probably it is the environment variables.<br>
<br>
My .bashrc file looks like:<br>
<br>
export QTDIR=/usr/local/Trolltech/Qt-4.1.4<br>
export QTDIR<br>
<br>
export PATH=$PATH:/usr/local/Trolltech/Qt-4.1.4/bin/<br>
export PATH<br>
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/<br>
<br><br>I hope this helps you.<br><br>Cheers,<br><span>Anja</span><div><span><br><br><div><span class="gmail_quote">On 13/10/06, <b class="gmail_sendername">Ashish Singh</b>
<<a href="mailto:mrasingh@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mrasingh@gmail.com</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Even, I want to make a slider in my vtk application. I was planning to use Qt for that, but for some reason I cannot get Qt to run with vtk. How are you doing it, Anja? I have Qt
4.1.4 and VTK 5.0.2 installed on my workstation (windows xp pro x64). Both of them are running independently but I don't know how to use them together in the same application. How did you configure them?
<br><br>Thanks,<br>Ashish<br><br><div><div><span><span class="gmail_quote">On 10/13/06, <b class="gmail_sendername">Anja Ende</b> <<a href="mailto:anja.ende@googlemail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
anja.ende@googlemail.com</a>> wrote:</span></span></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><span>
<span class="gmail_quote"></span>Hi Spencer,<br><div><br>What GUI framework are you using for displaying the sliders? This should be completely independent from vtk.<br><br>I use Qt and use QSlider and it works fine.<br>
<br>
Cheers,<span>Anja
</span></div></span></div>
<br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br><br><br></blockquote></div><br>
</blockquote></div>
</span></div></blockquote></div><br>
</span></div></blockquote></div><br><br clear="all"><br></span></div>-- <br>Cheers,<br><span><br>Anja
</span></blockquote></div><br>
</span></div></blockquote></div><br><br clear="all"><br></span></div>-- <br>Cheers,<br><span><br>Anja
</span></blockquote></div><br>
</span></div><br clear="all"></blockquote></div><br><br clear="all"><br>-- <br>Cheers,<br><br>Anja