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

Khojaste, Amir amir.khojaste at sunnybrook.ca
Thu May 14 16:15:48 EDT 2015


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] On Behalf Of chasank
Sent: May-13-15 5:48 PM
To: 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

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.



More information about the Insight-users mailing list