where is the .h header file?

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
gavin_dcm
Posts: 28
Joined: Tue, 2007-12-25, 04:27

where is the .h header file?

#1 Post by gavin_dcm »

firstly, i have read the install file of dcmtk. following the step of install file, i use cmake to generate dcmtk, then use ms vs6.0 to rebuild it successfully.there are many .cxx files and others,but none of .h file. i can't find it in corresponding folder. so how to #include the .h file to my .cpp file?

PS: must i learn a lot of knowledge about cmake in order to use dcmtk?

thanks

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

The header files are in the include directories, as usual. Btw, did you read FAQ #40

gavin_dcm
Posts: 28
Joined: Tue, 2007-12-25, 04:27

#3 Post by gavin_dcm »

Jörg Riesmeier wrote:The header files are in the include directories, as usual. Btw, did you read FAQ #40
=======================================
yes,i read it ,but in FAQ#40 the step 4 belowing,

4.Select INSTALL in order to install the DCMTK files to the directory specified using CMake.



How to do it in detail? thanks!

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier »

Select the target "INSTALL" on the left side of the screen and then "Build" it. This is the same mechanism as you've used in step 3 when you've selected "ALL_BUILD".

gavin_dcm
Posts: 28
Joined: Tue, 2007-12-25, 04:27

#5 Post by gavin_dcm »

Jörg Riesmeier wrote:Select the target "INSTALL" on the left side of the screen and then "Build" it. This is the same mechanism as you've used in step 3 when you've selected "ALL_BUILD".
==========================================
thanks, when i use cmake, I write the source code path which is equal to binaries path, following stey 1 to 4 above, so i get .h files.but it's very very difficult for me to understand cmake. it's too complex.
Last edited by gavin_dcm on Tue, 2010-05-04, 20:44, edited 1 time in total.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#6 Post by Jörg Riesmeier »

No, unfortunately not unless you want to create the project files manually. DCMTK requires CMake in order to create the project files - at least for the Windows platform. CMake might be complex but only for a developer who needs to create the CMakeLists.txt files. Using CMake is as easy as using any other Windows application and IMHO much easier than creating VisualStudio project files directly.

Did you really read the INSTALL file which is shipped with the DCMTK source code package?

gavin_dcm
Posts: 28
Joined: Tue, 2007-12-25, 04:27

#7 Post by gavin_dcm »

perfectly, i have general idea about cmake.and i can implement stey 1 throught stey5 of FAQ40.thanks!
but i want to develop my program with visual studio 2008 and above,must i change the cmake conmand of the setting for visual studio 2008 ???? if so,how todo it?



# settings for Microsoft Visual C++ 6

SET(CMAKE_C_FLAGS "/nologo /W3 /GX /Gy /YX")
SET(CMAKE_C_FLAGS_DEBUG "/MTd /Z7 /Od")
SET(CMAKE_C_FLAGS_RELEASE "/MT /O2")
SET(CMAKE_CXX_FLAGS "/nologo /W3 /GX /Gy /YX")
SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od")
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2")

ADD_DEFINITIONS(-D_REENTRANT)

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#8 Post by Jörg Riesmeier »

The settings for VisualStudio 2008 are the same as for the 2005 version. See main CMakeLists.txt file of the current snapshot.

gavin_dcm
Posts: 28
Joined: Tue, 2007-12-25, 04:27

#9 Post by gavin_dcm »

i appreciate your help!

will the cmake setting support MFC or CLR(.net frameworks)?

gavin_dcm
Posts: 28
Joined: Tue, 2007-12-25, 04:27

#10 Post by gavin_dcm »

i generalte dcmk with support of libpng libtiff、OpenSSL
and so on ,then i compile it using vc++6.0 ,i get 10 warnings belowing,what is worse,i can't compile the source code in stey5 of FAQ40

--------------------Configuration: dcmmklut - Win32 Debug--------------------
Compiling...
dcmmklut.cxx
Linking...
--------------------Configuration: dcmodify - Win32 Debug--------------------
Compiling...
dcmodify.cxx
mdfconen.cxx
mdfdsman.cxx
Linking...
--------------------Configuration: dcmtls - Win32 Debug--------------------
Compiling...
tlslayer.cxx
tlstrans.cxx
Creating library...
--------------------Configuration: dcmp2pgm - Win32 Debug--------------------
Compiling...
dcmp2pgm.cxx
Linking...
LINK : warning LNK4049: locally defined symbol "_xmlFree" imported
--------------------Configuration: dcmprscp - Win32 Debug--------------------
Compiling...
dcmprscp.cxx
Linking...
LINK : warning LNK4049: locally defined symbol "_xmlFree" imported
--------------------Configuration: dcmprscu - Win32 Debug--------------------
Compiling...
dcmprscu.cxx
Linking...
LINK : warning LNK4049: locally defined symbol "_xmlFree" imported
--------------------Configuration: dcmpschk - Win32 Debug--------------------
Compiling...
dcmpschk.cxx
vrscan.cxx
Linking...
--------------------Configuration: dcmpsmk - Win32 Debug--------------------
Compiling...
dcmpsmk.cxx
Linking...
--------------------Configuration: dcmpsprt - Win32 Debug--------------------
Compiling...
dcmpsprt.cxx
Linking...
LINK : warning LNK4049: locally defined symbol "_xmlFree" imported
--------------------Configuration: dcmpsrcv - Win32 Debug--------------------
Compiling...
dcmpsrcv.cxx
Linking...
--------------------Configuration: dcmpssnd - Win32 Debug--------------------
Compiling...
dcmpssnd.cxx
Linking...
--------------------Configuration: dcmqridx - Win32 Debug--------------------
Compiling...
dcmqridx.cxx
Linking...
--------------------Configuration: dcmqrscp - Win32 Debug--------------------
Compiling...
dcmqrscp.cxx
Linking...
--------------------Configuration: dcmqrti - Win32 Debug--------------------
Compiling...
dcmqrti.cxx
Linking...
--------------------Configuration: dcmquant - Win32 Debug--------------------
Compiling...
dcmquant.cxx
Linking...
--------------------Configuration: dcmscale - Win32 Debug--------------------
Compiling...
dcmscale.cxx
Linking...
--------------------Configuration: dcmsign - Win32 Debug--------------------
Compiling...
dcmsign.cxx
Linking...
--------------------Configuration: dcmwlm - Win32 Debug--------------------
Compiling...
wlds.cxx
wldsfs.cxx
wlfsim.cxx
wlmactmg.cxx
Creating library...
--------------------Configuration: dcod2lum - Win32 Debug--------------------
Compiling...
dcod2lum.cxx
Linking...
--------------------Configuration: dconvlum - Win32 Debug--------------------
Compiling...
dconvlum.cxx
Linking...
--------------------Configuration: dsr2html - Win32 Debug--------------------
Compiling...
dsr2html.cxx
Linking...
LINK : warning LNK4049: locally defined symbol "_xmlFree" imported
--------------------Configuration: dsr2xml - Win32 Debug--------------------
Compiling...
dsr2xml.cxx
Linking...
LINK : warning LNK4049: locally defined symbol "_xmlFree" imported
--------------------Configuration: dsrdump - Win32 Debug--------------------
Compiling...
dsrdump.cxx
Linking...
LINK : warning LNK4049: locally defined symbol "_xmlFree" imported
--------------------Configuration: dump2dcm - Win32 Debug--------------------
Compiling...
dump2dcm.cxx
Linking...
--------------------Configuration: echoscu - Win32 Debug--------------------
Compiling...
echoscu.cxx
Linking...
--------------------Configuration: findscu - Win32 Debug--------------------
Compiling...
findscu.cxx
Linking...
--------------------Configuration: mkreport - Win32 Debug--------------------
Compiling...
mkreport.cxx
Linking...
LINK : warning LNK4049: locally defined symbol "_xmlFree" imported
--------------------Configuration: movescu - Win32 Debug--------------------
Compiling...
movescu.cxx
Linking...
--------------------Configuration: pdf2dcm - Win32 Debug--------------------
Compiling...
pdf2dcm.cxx
Linking...
--------------------Configuration: storescp - Win32 Debug--------------------
Compiling...
storescp.cxx
Linking...
--------------------Configuration: storescu - Win32 Debug--------------------
Compiling...
storescu.cxx
Linking...
--------------------Configuration: termscu - Win32 Debug--------------------
Compiling...
termscu.cxx
Linking...
--------------------Configuration: wlmscpfs - Win32 Debug--------------------
Compiling...
wlmscpfs.cxx
wlcefs.cxx
Linking...
--------------------Configuration: xml2dcm - Win32 Debug--------------------
Compiling...
xml2dcm.cxx
Linking...
LINK : warning LNK4049: locally defined symbol "_xmlFree" imported
--------------------Configuration: xml2dsr - Win32 Debug--------------------
Compiling...
xml2dsr.cxx
Linking...
LINK : warning LNK4049: locally defined symbol "_xmlFree" imported
--------------------Configuration: ALL_BUILD - Win32 Debug--------------------

ALL_BUILD - 0 error(s), 10 warning(s)

gavin_dcm
Posts: 28
Joined: Tue, 2007-12-25, 04:27

#11 Post by gavin_dcm »

here is the cmakelists.txt in stey5 ,ot have a little change by me
---------------------------------------
PROJECT(testapp)

CMAKE_MINIMUM_REQUIRED(VERSION 2.0)

SET(DCMTK_DIR D:/dcmtk-3.5.4/dcmtk-3.5.4-win32-i386)

# settings for Microsoft Visual C++ 6
SET(CMAKE_C_FLAGS "/nologo /W3 /GX /Gy /YX")
SET(CMAKE_C_FLAGS_DEBUG "/MTd /Z7 /Od")
SET(CMAKE_C_FLAGS_RELEASE "/MT /O2")
SET(CMAKE_CXX_FLAGS "/nologo /W3 /GX /Gy /YX")
SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od")
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2")

ADD_DEFINITIONS(-D_REENTRANT)

INCLUDE_DIRECTORIES(${DCMTK_DIR}/include)
LINK_DIRECTORIES(${DCMTK_DIR}/lib)

ADD_EXECUTABLE(testapp hhh)
TARGET_LINK_LIBRARIES(testapp netapi32 wsock32 ofstd dcmdata)
------------------------------------------------------------------------------------

here is the errors when i compile the source code


--------------------Configuration: testapp - Win32 Debug--------------------
Building Custom Rule D:/hhh/CMakeLists.txt
-- Configuring done
-- Generating done
-- Build files have been written to: D:/hhh
Compiling...
hhh.cxx
Linking...
dcmdata.lib(dcistrmz.obj) : error LNK2001: unresolved external symbol _inflateInit2_
dcmdata.lib(dcistrmz.obj) : error LNK2001: unresolved external symbol _inflateInit_
dcmdata.lib(dcistrmz.obj) : error LNK2001: unresolved external symbol _inflateEnd
dcmdata.lib(dcistrmz.obj) : error LNK2001: unresolved external symbol _inflate
dcmdata.lib(dcostrmz.obj) : error LNK2001: unresolved external symbol _deflateInit2_
dcmdata.lib(dcostrmz.obj) : error LNK2001: unresolved external symbol _deflateEnd
dcmdata.lib(dcostrmz.obj) : error LNK2001: unresolved external symbol _deflate
D:\hhh\Debug/testapp.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.

ALL_BUILD - 8 error(s), 0 warning(s)

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

#12 Post by Michael Onken »

Hi,

You miss linking ZLIB.

Best regards,
Michael

gavin_dcm
Posts: 28
Joined: Tue, 2007-12-25, 04:27

#13 Post by gavin_dcm »

Michael Onken wrote:Hi,

You miss linking ZLIB.

Best regards,
Michael
==========================
thanks ,i revise it now。i think i have learned so much from you. it's so lucky to be taught by such a expert who is full of intelligence and patience .good luck and best wishes

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest