[ITK-users] [ITK] Building QT, VTK and ITK on windows 7 (x64)

Khojaste, Amir amir.khojaste at sunnybrook.ca
Fri May 15 09:33:12 EDT 2015


Hi there,

Yes, I did but still the same error remains the same. It occurs when I include the “itkImageFileReader.h” in my source code.

Here is my “.pro” contents:

#-------------------------------------------------
#
# Project created by QtCreator 2015-05-14T15:50:25
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = testITK
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

DEFINES += “vtkRenderingCore_AUTOINIT=4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)”
DEFINES += “vtkRenderingVolume_AUTOINIT=1(vtkRenderingVolumeOpenGL)”
DEFINES += _CRT_SECURE_NO_WARNINGS

win32: LIBS += “advapi32.lib” “ws2_32.lib” “Rpcrt4.lib”

win32: LIBS += -LC:/vtk/x64/6.0.0/install/lib \
-lvtkChartsCore-6.0 \
-lvtkCommonColor-6.0 \
-lvtkCommonComputationalGeometry-6.0 \
-lvtkCommonCore-6.0 \
-lvtkCommonDataModel-6.0 \
-lvtkCommonExecutionModel-6.0 \
-lvtkCommonMath-6.0 \
-lvtkCommonMisc-6.0 \
-lvtkCommonSystem-6.0 \
-lvtkCommonTransforms-6.0 \
-lvtkDICOMParser-6.0 \
-lvtkDomainsChemistry-6.0 \
-lvtkFiltersAMR-6.0 \
-lvtkFiltersCore-6.0 \
-lvtkFiltersExtraction-6.0 \
-lvtkFiltersFlowPaths-6.0 \
-lvtkFiltersGeneral-6.0 \
-lvtkFiltersGeneric-6.0 \
-lvtkFiltersGeometry-6.0 \
-lvtkFiltersHybrid-6.0 \
-lvtkFiltersHyperTree-6.0 \
-lvtkFiltersImaging-6.0 \
-lvtkFiltersModeling-6.0 \
-lvtkFiltersParallel-6.0 \
-lvtkFiltersParallelImaging-6.0 \
-lvtkFiltersProgrammable-6.0 \
-lvtkFiltersSelection-6.0 \
-lvtkFiltersSources-6.0 \
-lvtkFiltersStatistics-6.0 \
-lvtkFiltersTexture-6.0 \
-lvtkFiltersVerdict-6.0 \
-lvtkGUISupportQt-6.0 \
-lvtkGUISupportQtOpenGL-6.0 \
-lvtkGeovisCore-6.0 \
-lvtkIOAMR-6.0 \
-lvtkIOCore-6.0 \
-lvtkIOEnSight-6.0 \
-lvtkIOExodus-6.0 \
-lvtkIOExport-6.0 \
-lvtkIOGeometry-6.0 \
-lvtkIOImage-6.0 \
-lvtkIOImport-6.0 \
-lvtkIOInfovis-6.0 \
-lvtkIOLSDyna-6.0 \
-lvtkIOLegacy-6.0 \
-lvtkIOMINC-6.0 \
-lvtkIOMovie-6.0 \
-lvtkIONetCDF-6.0 \
-lvtkIOPLY-6.0 \
-lvtkIOParallel-6.0 \
-lvtkIOSQL-6.0 \
-lvtkIOVideo-6.0 \
-lvtkIOXML-6.0 \
-lvtkIOXMLParser-6.0 \
-lvtkImagingColor-6.0 \
-lvtkImagingCore-6.0 \
-lvtkImagingFourier-6.0 \
-lvtkImagingGeneral-6.0 \
-lvtkImagingHybrid-6.0 \
-lvtkImagingMath-6.0 \
-lvtkImagingMorphological-6.0 \
-lvtkImagingSources-6.0 \
-lvtkImagingStatistics-6.0 \
-lvtkImagingStencil-6.0 \
-lvtkInfovisCore-6.0 \
-lvtkInfovisLayout-6.0 \
-lvtkInteractionImage-6.0 \
-lvtkInteractionStyle-6.0 \
-lvtkInteractionWidgets-6.0 \
-lvtkNetCDF-6.0 \
-lvtkNetCDF_cxx-6.0 \
-lvtkParallelCore-6.0 \
-lvtkRenderingAnnotation-6.0 \
-lvtkRenderingContext2D-6.0 \
-lvtkRenderingCore-6.0 \
-lvtkRenderingFreeType-6.0 \
-lvtkRenderingFreeTypeOpenGL-6.0 \
-lvtkRenderingGL2PS-6.0 \
-lvtkRenderingHybridOpenGL-6.0 \
-lvtkRenderingImage-6.0 \
-lvtkRenderingLOD-6.0 \
-lvtkRenderingLabel-6.0 \
-lvtkRenderingOpenGL-6.0 \
-lvtkRenderingVolume-6.0 \
-lvtkRenderingVolumeAMR-6.0 \
-lvtkRenderingVolumeOpenGL-6.0 \
-lvtkViewsContext2D-6.0 \
-lvtkViewsCore-6.0 \
-lvtkViewsGeovis-6.0 \
-lvtkViewsInfovis-6.0 \
-lvtkalglib-6.0 \
-lvtkexoIIc-6.0 \
-lvtkexpat-6.0 \
-lvtkfreetype-6.0 \
-lvtkftgl-6.0 \
-lvtkgl2ps-6.0 \
-lvtkhdf5-6.0 \
-lvtkhdf5_hl-6.0 \
-lvtkjpeg-6.0 \
-lvtkjsoncpp-6.0 \
-lvtklibxml2-6.0 \
-lvtkmetaio-6.0 \
-lvtkoggtheora-6.0 \
-lvtkpng-6.0 \
-lvtkproj4-6.0 \
-lvtksqlite-6.0 \
-lvtksys-6.0 \
-lvtktiff-6.0 \
-lvtkverdict-6.0 \
-lvtkzlib-6.0

INCLUDEPATH += C:/vtk/x64/6.0.0/install/include/vtk-6.0
DEPENDPATH += C:/vtk/x64/6.0.0/install/include/vtk-6.0

win32: LIBS += -LC:/ITK/x64/4.4.0/install/lib \
-lITKBiasCorrection-4.4 \
-lITKBioCell-4.4 \
-lITKCommon-4.4 \
-lITKDICOMParser-4.4 \
-litkdouble-conversion-4.4 \
-lITKEXPAT-4.4 \
-lITKFEM-4.4 \
-litkgdcmCommon-4.4 \
-litkgdcmDICT-4.4 \
-litkgdcmDSED-4.4 \
-litkgdcmIOD-4.4 \
-litkgdcmjpeg12-4.4 \
-litkgdcmjpeg16-4.4 \
-litkgdcmjpeg8-4.4 \
-litkgdcmMSFF-4.4 \
-lITKgiftiio-4.4 \
-litkhdf5-4.4 \
-litkhdf5_cpp-4.4 \
-lITKIOBioRad-4.4 \
-lITKIOBMP-4.4 \
-lITKIOCSV-4.4 \
-lITKIOGDCM-4.4 \
-lITKIOGE-4.4 \
-lITKIOGIPL-4.4 \
-lITKIOHDF5-4.4 \
-lITKIOImageBase-4.4 \
-lITKIOIPL-4.4 \
-lITKIOJPEG-4.4 \
-lITKIOLSM-4.4 \
-lITKIOMesh-4.4 \
-lITKIOMeta-4.4 \
-lITKIONIFTI-4.4 \
-lITKIONRRD-4.4 \
-lITKIOPNG-4.4 \
-lITKIOSiemens-4.4 \
-lITKIOSpatialObjects-4.4 \
-lITKIOStimulate-4.4 \
-lITKIOTIFF-4.4 \
-lITKIOTransformBase-4.4 \
-lITKIOTransformHDF5-4.4 \
-lITKIOTransformInsightLegacy-4.4 \
-lITKIOTransformMatlab-4.4 \
-lITKIOVTK-4.4 \
-lITKIOXML-4.4 \
-litkjpeg-4.4 \
-lITKKLMRegionGrowing-4.4 \
-lITKLabelMap-4.4 \
-lITKMesh-4.4 \
-lITKMetaIO-4.4 \
-litkNetlibSlatec-4.4 \
-lITKniftiio-4.4 \
-lITKNrrdIO-4.4 \
-litkopenjpeg-4.4 \
-lITKOptimizers-4.4 \
-lITKOptimizersv4-4.4 \
-lITKPath-4.4 \
-litkpng-4.4 \
-lITKPolynomials-4.4 \
-lITKQuadEdgeMesh-4.4 \
-lITKReview-4.4 \
-lITKSpatialObjects-4.4 \
-lITKStatistics-4.4 \
-litksys-4.4 \
-litktiff-4.4 \
-litkv3p_lsqr-4.4 \
-litkv3p_netlib-4.4 \
-litkvcl-4.4 \
-lITKVideoCore-4.4 \
-lITKVideoIO-4.4 \
-litkvnl-4.4 \
-lITKVNLInstantiation-4.4 \
-litkvnl_algo-4.4 \
-lITKVTK-4.4 \
-lITKVtkGlue-4.4 \
-lITKWatersheds-4.4 \
-litkzlib-4.4 \
-lITKznz-4.4

INCLUDEPATH += C:/ITK/x64/4.4.0/install/include/ITK-4.4
DEPENDPATH += C:/ITK/x64/4.4.0/install/include/ITK-4.4


It is very confusing, I can see that the library is there but it is telling me that it can’t find itksys-4.4.lib!! Any clue?

Thanks,
Amir

From: Мар'ян Климов [mailto:nekto1989 at gmail.com]
Sent: May-14-15 5:01 PM
To: Khojaste, Amir
Cc: chasank; insight-users at itk.org
Subject: Re: [ITK] [ITK-users] Building QT, VTK and ITK on windows 7 (x64)

Hi,
Are you sure you've added "advapi32.lib" to libs?

win32: LIBS += “advapi32.lib” “ws2_32.lib” “Rpcrt4.lib”

2015-05-14 23:15 GMT+03:00 Khojaste, Amir <amir.khojaste at sunnybrook.ca<mailto:amir.khojaste at sunnybrook.ca>>:
Hi Chasank,

Thanks for sharing this. I was looking to find a way to use ITK, VTK libraries under Qt Creator too. This is great! However I was not able to run my project in Qt Creator with ITK and VTK libraries.

I have followed all the steps of your tutorials with the exact same versions except that I have used CMake 3.1.3 instead of 2.8.11. ITK, VTK and Qt were built with no errors.

After I have finished all the steps, I have created a project in Qt Creator, modified the ".pro" file as you mentioned. I am just trying to see if I can get the ITK to work. It might seem very stupid, but when the following code runs with no error.

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "itkImage.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pushButton_clicked()
{

    typedef itk::Image<unsigned char, 3> ImageType;

    ImageType::Pointer image = ImageType::New();

}

Everything runs with no error, however as soon as I add the RedaerType then everything is screwd! i.e. the following code will crash!

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "itkImage.h"
#include "itkImageFileReader.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pushButton_clicked()
{

    typedef itk::Image<unsigned char, 3> ImageType;

    ImageType::Pointer image = ImageType::New();

    typedef itk::ImageFileReader<ImageType> ReaderType;

    ReaderType::Pointer reader = ReaderType::New();

}

And that's the error that I get:

itksys-4.4.lib(SystemTools.obj):-1: error: LNK2019: unresolved external symbol __imp_RegQueryValueExA referenced in function "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl itksys::SystemTools::GetOperatingSystemNameAndVersion(void)" (?GetOperatingSystemNameAndVersion at SystemTools@itksys@@SA?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@XZ)

I am very confused! The interesting thing is that after I get the error, even the first version of my code (with only itkImage.h) will not work neither!


Do you have any clue?

Thanks,
Amir

-----Original Message-----
From: Insight-users [mailto:insight-users-bounces at itk.org<mailto:insight-users-bounces at itk.org>] On Behalf Of chasank
Sent: May-13-15 5:48 PM
To: insight-users at itk.org<mailto:insight-users at itk.org>
Subject: [ITK-users] Building QT, VTK and ITK on windows 7 (x64)

Hi folks and beginners,

I've written a step by step tutorial for building qt, vtk and itk from source 64 bit on a windows os. As I stated at my blog; versions may be a little outdated but as I tested this tutorial for myself for many times. I may say they are working together like a charm.
You may replicate this tutorial to newer versions of these sdks. I have not tested with newer versions but approximately process should be same.

Note that for building projects I did not use CMAKE. I have handled it with QT's pro files.

Blog link:
http://blog.chasank.com/building-qt-vtk-and-itk-on-windows-7-x64/
<http://blog.chasank.com/building-qt-vtk-and-itk-on-windows-7-x64/>

Best regards.
May the force be with you.



--
View this message in context: http://itk-users.7.n7.nabble.com/Building-QT-VTK-and-ITK-on-windows-7-x64-tp35668.html
Sent from the ITK - Users mailing list archive at Nabble.com.
_____________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
This e-mail is intended only for the named recipient(s) and may contain confidential, personal and/or health information (information which may be subject to legal restrictions on use, retention and/or disclosure).  No waiver of confidence is intended by virtue of communication via the internet.  Any review or distribution by anyone other than the person(s) for whom it was originally intended is strictly prohibited.  If you have received this e-mail in error, please contact the sender and destroy all copies.

_____________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
_______________________________________________
Community mailing list
Community at itk.org<mailto:Community at itk.org>
http://public.kitware.com/mailman/listinfo/community

This e-mail is intended only for the named recipient(s) and may contain confidential, personal and/or health information (information which may be subject to legal restrictions on use, retention and/or disclosure).  No waiver of confidence is intended by virtue of communication via the internet.  Any review or distribution by anyone other than the person(s) for whom it was originally intended is strictly prohibited.  If you have received this e-mail in error, please contact the sender and destroy all copies.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20150515/ec1fbee9/attachment-0001.html>


More information about the Insight-users mailing list