How to change path to DCMTK INCLUDE installation folder in every .h file

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ahirnish
Posts: 38
Joined: Wed, 2012-01-04, 10:18

How to change path to DCMTK INCLUDE installation folder in every .h file

#1 Post by ahirnish »

Is there any script or do I have to change the path of #include "..." in every header file by myself. Since, there are so many files and every file is connected to other header files, it becomes cumbersome to change the path manually.

Michael Onken
DCMTK Developer
Posts: 2054
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#2 Post by Michael Onken »

Hi,

why do you like to change header file paths? For your own development, install DCMTK (Target "INSTALL" in Visual Studio or "make install" in Unix-like systems) and then set your include path to /your/DCMTK-install-path/include. Then all header includes should be just fine!

Best regards,
Michael

ahirnish
Posts: 38
Joined: Wed, 2012-01-04, 10:18

#3 Post by ahirnish »

Suppose I've to include scu.h in dcmnet. I give path to include as the installed folder but scu.h itself include some other header files from dcmdata, which I am not including. And thus, error is generated as the include path in that .h file from dcmdata lib is not the correct path. That means I've to change include path in that .h file also and eventually, in all associated header files. Isn't it?

Michael Onken
DCMTK Developer
Posts: 2054
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#4 Post by Michael Onken »

Hi,

I think you might have something wrong in how things work. Every include in DCMTK is of the format

Code: Select all

#include "dcmtk/$somelibrary/someheader.h"
, e.g. #include "dcmtk/dcmdata/dctk.h"

If you have installed DCMTK to a directory (by performing the steps mentioned some posts before), you have the following directory structure somewhere on your disk (e.g. c:\programs\DCMTK):

Code: Select all

c:\programs\DCMTK\bin
c:\programs\DCMTK\etc
c:\programs\DCMTK\include
[...]
Within the include folder, you will have (besides others)

Code: Select all

c:\programs\DCMTK\include\dcmtk\dcmdata\dctk.h
c:\programs\DCMTK\include\dcmtk\ofstd\ofstring.h
c:\programs\DCMTK\include\dcmtk\config\osconfig.h
So, if you compile your own project, you add "c:\programs\DCMTK\include" to your compiler's include path, which is usually done by adding an option like -I"c:\programs\DCMTK\include".

This then permits you to use DCMTK in your own files like this:
#include "dcmtk/dcmdata/dctk.h" which is the same way DCMTK itself uses. Thus, your header file inclusions are correct and found by the compiler if you do it that way, and, the header file inclusions within DCMTK are automatically correct at the same time since they use exactly the same format. Is that clear?

Good luck,
Michael

prakash
Posts: 50
Joined: Mon, 2008-05-19, 10:34
Contact:

How to change path to of DCMTK Libraries from one system to other system

#5 Post by prakash »

Hi Michael,

I did the same thing as you mentioned in your earlier posts. But i am facing different issue.
I installed on my local machine to D:\DICOM\DCMTK ..., then i want to change the entire solutions and respected files to different machine to other location such as E:\DCMTK . I copied the entire files and started building the solution from there onwards but i am getting lot of errors.

Can you tell me the simple way of changing this folder paths other than changing each solution and each file manually.

If manually also tries to change, where all places i need to change.

Thanks & regards,
Prakash

Post Reply

Who is online

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