How to compile and link dcmtk in Qt

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
fruan
Posts: 2
Joined: Wed, 2010-08-04, 22:34

How to compile and link dcmtk in Qt

#1 Post by fruan »

Hi,

I want to use dcmtk library in a Qt application. The library is built by Visual Studio 2008. Now I want to use it in QT. After I configure the includepath and libs and build the application, it is said that some header, e.g. "iostream.h" is not found. Maybe the correct header is "iostream", not "iostream.h". How can I set up Qt to pass the building?

I doubt this is related to the compiler. My QT build setting is as follows:
"
qmake.exe D:/DICOM_Viewer/imageviewer.pro -r -spec win32-g++
"

Do I need to configure to use a different compiler? e.g. msvc2008


Thanks!
Last edited by fruan on Fri, 2010-08-06, 15:44, edited 1 time in total.

jeromnimo
Posts: 10
Joined: Tue, 2010-05-18, 15:24
Location: France
Contact:

#2 Post by jeromnimo »

Hi fruan,

if you want to use libs in your application, you have to compile it first.

Then, you can link your project with dcmk libs (dcmdata, dcmnet...) with includepath correctly set to dcmtk headers path.

You have to use the same compiler for libs and for your project (if you use msvc, you will obtain .lib, usable in msvc for link)

Hope this will help you ;)

fruan
Posts: 2
Joined: Wed, 2010-08-04, 22:34

#3 Post by fruan »

Thanks so much!

So the correct step is:
1. build library in Visual Studio 2008.
2. Setup compiler to VS 2008 in Qt project
3. Setup path for include and lib files
4. Build in Qt

Right?

If I want to run my application in Linux, I need to use linux compiler, e.g. g++ to build the library and then setup g++ compiler in Qt. Then Qt can pass its building, right?

jeromnimo
Posts: 10
Joined: Tue, 2010-05-18, 15:24
Location: France
Contact:

#4 Post by jeromnimo »

Yes, you're right ;)

and if you use mvsc on windows, you have to change for building under linux, of course.

ali.m.habib
Posts: 85
Joined: Sun, 2010-12-26, 17:34

#5 Post by ali.m.habib »

fruan wrote:Thanks so much!

So the correct step is:
1. build library in Visual Studio 2008.
2. Setup compiler to VS 2008 in Qt project
3. Setup path for include and lib files
4. Build in Qt

Right?

If I want to run my application in Linux, I need to use linux compiler, e.g. g++ to build the library and then setup g++ compiler in Qt. Then Qt can pass its building, right?
could you give me more details in how to build for qt and use it , forgive me but I am a newbie to qt and dcmtk

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest