compilation with dcmtk

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
sandres
Posts: 4
Joined: Wed, 2004-12-22, 17:41

compilation with dcmtk

#1 Post by sandres »

Hi all,

I am trying to compile my own library, which uses dcmtk, on Linux.
I got the following error message and I do not understand what it means:

"/home/cv/sordas/sandres/dcmtk-3.5.3/ofstd/include/ofstream.h:76:2: #error DCMTK needs stringstream or strstream type"

I built the dcmtk libraries following the instructions in INSTALL file.

I would appreciate any help to solve this problem...
Thanks in advance.

Sergio.

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 »

A few questions:
  • Which compiler (incl. version number) are you using?
  • Does this error occur when you compile the DCMTK or your own program which uses DCMTK?
  • Did you already try to set '--enable-std-includes' for configure?
If the DCMTK compiles correctly and the error only occurs when you compile your own program:
  • Did you include "osconfig.h" as the first line of your source and header files?

sandres
Posts: 4
Joined: Wed, 2004-12-22, 17:41

compilation with dcmtk

#3 Post by sandres »

My compiler version is gcc 3.3.3.

These errors occur when I compile my own library, which uses dcmtk.

I set --enable-std-includes for configure.

I added #include <osconfig.h> in my .cpp file, but the same errors come up.

The first message is the following (as an example):

/home/cv/sordas/sandres/dcmtk-3.5.3/ofstd/include/ofstream.h:76:2: #error DCMTK needs stringstream or strstream type
In file included from /home/cv/sordas/sandres/dcmtk-3.5.3/ofstd/include/ofstring.h:70,
from /home/cv/sordas/sandres/dcmtk-3.5.3/ofstd/include/ofthread.h:43,
from /home/cv/sordas/sandres/dcmtk-3.5.3/ofstd/include/ofglobal.h:42,
from /home/cv/sordas/sandres/dcmtk-3.5.3/dcmimgle/include/diutils.h:39,
from /home/cv/sordas/sandres/BaseLib/image/image/blDICOMDirReader.cpp:27:


It seems to be a problem about dcmtk configuration...

Thanks!
Sergio.

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 »

It seems to be a problem about dcmtk configuration...
Could also be a configuration problem of your application (includes, makefile, etc.). As far as I understood your previous posting the DCMTK compiles without any problems.

Do you have a minimum example (source file plus makefile) that reproduces the error?

sandres
Posts: 4
Joined: Wed, 2004-12-22, 17:41

compilation with dcmtk

#5 Post by sandres »

Jörg Riesmeier wrote: Do you have a minimum example (source file plus makefile) that reproduces the error?
The makefile for my library is generated by CMake program. It is included at the end.

Thanks!
Sergio.



The source code where the error occurs is:

Code: Select all

#include <itksys/Directory.hxx>
#include <itksys/SystemTools.hxx>

#include <osconfig.h>
#include <diutils.h>    // <-- ERROR HERE
Makefile:
------------------------------
# CMAKE generated Makefile, DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 1.8
# Generated from the following files:
# /home/cv/sordas/sandres/BaseLib/CMakeCache.txt
# /extra/local/share/CMake/Modules/CMakeDefaultMakeRuleVariables.cmake
# /extra/local/share/CMake/Modules/CMakeImportBuildSettings.cmake
# /extra/local/share/CMake/Modules/CMakeSystemSpecificInformation.cmake
# /extra/local/share/CMake/Modules/FindITK.cmake
# /extra/local/share/CMake/Modules/Platform/Linux.cmake
# /extra/local/share/CMake/Modules/Platform/gcc.cmake
# /home/cv/sordas/sandres/BaseLib/BaseLibConfig.cmake.in
# /home/cv/sordas/sandres/BaseLib/BaseLibConfigure.h.in
# /home/cv/sordas/sandres/BaseLib/BaseLibIncludeDirectories.cmake
# /home/cv/sordas/sandres/BaseLib/CMakeCCompiler.cmake
# /home/cv/sordas/sandres/BaseLib/CMakeCXXCompiler.cmake
# /home/cv/sordas/sandres/BaseLib/CMakeLists.txt
# /home/cv/sordas/sandres/BaseLib/CMakeSystem.cmake
# /home/cv/sordas/sandres/BaseLib/UseBaseLib.cmake.in
# /home/cv/sordas/sandres/Insight/ITKBuildSettings.cmake
# /home/cv/sordas/sandres/Insight/ITKConfig.cmake
# /home/cv/sordas/sandres/Insight/ITKLibraryDepends.cmake
# /home/cv/sordas/sandres/Insight/UseITK.cmake


# Suppresses display of executed commands
.SILENT:
# disable some common implicit rules to speed things up
.SUFFIXES:
.SUFFIXES:.hpuxmakemusthaverule
CMAKE_MAKEFILE_SOURCES = /extra/local/share/CMake/Modules/CMakeDefaultMakeRuleVariables.cmake /extra/local/share/CMake/Modules/CMakeImportBuildSettings.cmake /extra/local/share/CMake/Modules/CMakeSystemSpecificInformation.cmake /extra/local/share/CMake/Modules/FindITK.cmake /extra/local/share/CMake/Modules/Platform/Linux.cmake /extra/local/share/CMake/Modules/Platform/gcc.cmake /home/cv/sordas/sandres/BaseLib/BaseLibConfig.cmake.in /home/cv/sordas/sandres/BaseLib/BaseLibConfigure.h.in /home/cv/sordas/sandres/BaseLib/BaseLibIncludeDirectories.cmake /home/cv/sordas/sandres/BaseLib/CMakeCCompiler.cmake /home/cv/sordas/sandres/BaseLib/CMakeCXXCompiler.cmake /home/cv/sordas/sandres/BaseLib/CMakeLists.txt /home/cv/sordas/sandres/BaseLib/CMakeSystem.cmake /home/cv/sordas/sandres/BaseLib/UseBaseLib.cmake.in /home/cv/sordas/sandres/Insight/ITKBuildSettings.cmake /home/cv/sordas/sandres/Insight/ITKConfig.cmake /home/cv/sordas/sandres/Insight/ITKLibraryDepends.cmake /home/cv/sordas/sandres/Insight/UseITK.cmake /home/cv/sordas/sandres/BaseLib/CMakeCache.txt


# the standard shell for make
SHELL = /bin/sh

CMAKE_COMMAND = /extra/local/bin/cmake
RM = /extra/local/bin/cmake -E remove -f
CMAKE_EDIT_COMMAND = /extra/local/bin/ccmake
CMAKE_CURRENT_SOURCE = /home/cv/sordas/sandres/BaseLib
CMAKE_CURRENT_BINARY = /home/cv/sordas/sandres/BaseLib
CMAKE_SOURCE_DIR = /home/cv/sordas/sandres/BaseLib
CMAKE_BINARY_DIR = /home/cv/sordas/sandres/BaseLib
INCLUDE_FLAGS = -I/home/cv/sordas/sandres/BaseLib -I/home/cv/sordas/sandres/BaseLib -I/home/cv/sordas/sandres/BaseLib/common -I/home/cv/sordas/sandres/BaseLib/image/image -I/home/cv/sordas/sandres/BaseLib/image/imageProperties -I/home/cv/sordas/sandres/BaseLib/image/imageUtilities -I/home/cv/sordas/sandres/BaseLib/pdshape/pdalignment -I/home/cv/sordas/sandres/BaseLib/pdshape/pdshape -I/home/cv/sordas/sandres/BaseLib/math -I/home/cv/sordas/sandres/BaseLib/utilities -I/home/cv/sordas/sandres/Insight -I/home/cv/sordas/sandres/Insight/Code/Algorithms -I/home/cv/sordas/sandres/Insight/Code/BasicFilters -I/home/cv/sordas/sandres/Insight/Code/Common -I/home/cv/sordas/sandres/Insight/Code/Numerics -I/home/cv/sordas/sandres/Insight/Code/IO -I/home/cv/sordas/sandres/Insight/Code/Numerics/FEM -I/home/cv/sordas/sandres/Insight/Code/Numerics/Statistics -I/home/cv/sordas/sandres/Insight/Code/SpatialObject -I/home/cv/sordas/sandres/Insight/Utilities/MetaIO -I/home/cv/sordas/sandres/Insight/Utilities/DICOMParser -I/home/cv/sordas/sandres/Insight/Utilities/expat -I/home/cv/sordas/sandres/Insight/Utilities -I/home/cv/sordas/sandres/Insight/Utilities/vxl/vcl -I/home/cv/sordas/sandres/Insight/Utilities/vxl/core -I/home/cv/sordas/sandres/Insight/Utilities/vxl/v3p/netlib -I/home/cv/sordas/sandres/dcmtk-3.5.3/config/include -I/home/cv/sordas/sandres/dcmtk-3.5.3/dcmdata/include -I/home/cv/sordas/sandres/dcmtk-3.5.3/dcmimgle/include -I/home/cv/sordas/sandres/dcmtk-3.5.3/ofstd/include

#---------------------------------------------------------
# Default target executed when no arguments are given to make, first make sure cmake.depends exists, cmake.check_depends is up-to-date, check the sources, then build the all target
#

default_target: /home/cv/sordas/sandres/BaseLib/cmake.check_cache
$(MAKE) $(MAKESILENT) cmake.depends
$(MAKE) $(MAKESILENT) cmake.check_depends
$(MAKE) $(MAKESILENT) -f cmake.check_depends
$(MAKE) $(MAKESILENT) all

help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... rebuild_cache"


TARGETS =

CLEAN_OBJECT_FILES =


# Variable for making default_target in subdirectories.
SUBDIR_BUILD = \
default_target_common \
default_target_image \
default_target_math \
default_target_pdshape \
default_target_utilities

# Targets for making default_target in subdirectories.
default_target_common: $(TARGETS)
@if test ! -d /home/cv/sordas/sandres/BaseLib/common; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/common: building default_target
@cd /home/cv/sordas/sandres/BaseLib/common; $(MAKE) default_target

default_target_image: $(TARGETS) default_target_common
@if test ! -d /home/cv/sordas/sandres/BaseLib/image; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/image: building default_target
@cd /home/cv/sordas/sandres/BaseLib/image; $(MAKE) default_target

default_target_math: $(TARGETS) default_target_image
@if test ! -d /home/cv/sordas/sandres/BaseLib/math; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/math: building default_target
@cd /home/cv/sordas/sandres/BaseLib/math; $(MAKE) default_target

default_target_pdshape: $(TARGETS) default_target_math
@if test ! -d /home/cv/sordas/sandres/BaseLib/pdshape; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/pdshape: building default_target
@cd /home/cv/sordas/sandres/BaseLib/pdshape; $(MAKE) default_target

default_target_utilities: $(TARGETS) default_target_pdshape
@if test ! -d /home/cv/sordas/sandres/BaseLib/utilities; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/utilities: building default_target
@cd /home/cv/sordas/sandres/BaseLib/utilities; $(MAKE) default_target



# Variable for making clean in subdirectories.
SUBDIR_CLEAN = \
clean_common \
clean_image \
clean_math \
clean_pdshape \
clean_utilities

# Targets for making clean in subdirectories.
clean_common:
@if test ! -d /home/cv/sordas/sandres/BaseLib/common; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/common: building clean
@cd /home/cv/sordas/sandres/BaseLib/common; $(MAKE) clean

clean_image: clean_common
@if test ! -d /home/cv/sordas/sandres/BaseLib/image; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/image: building clean
@cd /home/cv/sordas/sandres/BaseLib/image; $(MAKE) clean

clean_math: clean_image
@if test ! -d /home/cv/sordas/sandres/BaseLib/math; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/math: building clean
@cd /home/cv/sordas/sandres/BaseLib/math; $(MAKE) clean

clean_pdshape: clean_math
@if test ! -d /home/cv/sordas/sandres/BaseLib/pdshape; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/pdshape: building clean
@cd /home/cv/sordas/sandres/BaseLib/pdshape; $(MAKE) clean

clean_utilities: clean_pdshape
@if test ! -d /home/cv/sordas/sandres/BaseLib/utilities; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/utilities: building clean
@cd /home/cv/sordas/sandres/BaseLib/utilities; $(MAKE) clean



# Variable for making depend in subdirectories.
SUBDIR_DEPEND = \
depend_common \
depend_image \
depend_math \
depend_pdshape \
depend_utilities

# Targets for making depend in subdirectories.
depend_common:
@if test ! -d /home/cv/sordas/sandres/BaseLib/common; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/common: building depend
@cd /home/cv/sordas/sandres/BaseLib/common; $(MAKE) depend

depend_image: depend_common
@if test ! -d /home/cv/sordas/sandres/BaseLib/image; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/image: building depend
@cd /home/cv/sordas/sandres/BaseLib/image; $(MAKE) depend

depend_math: depend_image
@if test ! -d /home/cv/sordas/sandres/BaseLib/math; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/math: building depend
@cd /home/cv/sordas/sandres/BaseLib/math; $(MAKE) depend

depend_pdshape: depend_math
@if test ! -d /home/cv/sordas/sandres/BaseLib/pdshape; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/pdshape: building depend
@cd /home/cv/sordas/sandres/BaseLib/pdshape; $(MAKE) depend

depend_utilities: depend_pdshape
@if test ! -d /home/cv/sordas/sandres/BaseLib/utilities; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/utilities: building depend
@cd /home/cv/sordas/sandres/BaseLib/utilities; $(MAKE) depend



# Variable for making install in subdirectories.
SUBDIR_INSTALL = \
install_common \
install_image \
install_math \
install_pdshape \
install_utilities

# Targets for making install in subdirectories.
install_common:
@if test ! -d /home/cv/sordas/sandres/BaseLib/common; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/common: building install
@cd /home/cv/sordas/sandres/BaseLib/common; $(MAKE) install

install_image: install_common
@if test ! -d /home/cv/sordas/sandres/BaseLib/image; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/image: building install
@cd /home/cv/sordas/sandres/BaseLib/image; $(MAKE) install

install_math: install_image
@if test ! -d /home/cv/sordas/sandres/BaseLib/math; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/math: building install
@cd /home/cv/sordas/sandres/BaseLib/math; $(MAKE) install

install_pdshape: install_math
@if test ! -d /home/cv/sordas/sandres/BaseLib/pdshape; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/pdshape: building install
@cd /home/cv/sordas/sandres/BaseLib/pdshape; $(MAKE) install

install_utilities: install_pdshape
@if test ! -d /home/cv/sordas/sandres/BaseLib/utilities; then $(MAKE) rebuild_cache; fi
@echo /home/cv/sordas/sandres/BaseLib/utilities: building install
@cd /home/cv/sordas/sandres/BaseLib/utilities; $(MAKE) install



#---------------------------------------------------------
# default build rule
#

all: cmake.depends $(TARGETS) $(SUBDIR_BUILD)

#---------------------------------------------------------
# clean generated files
#

clean: $(SUBDIR_CLEAN)
-@ $(RM) $(CLEAN_OBJECT_FILES) $(TARGETS) $(GENERATED_QT_FILES) $(GENERATED_FLTK_FILES)

#---------------------------------------------------------
# dependencies.
#

cmake.depends: /home/cv/sordas/sandres/BaseLib/cmake.check_cache
cmake.depends: $(CMAKE_MAKEFILE_SOURCES)
@echo "Building dependencies. cmake.depends..."
$(CMAKE_COMMAND) -S$(CMAKE_CURRENT_SOURCE) -O$(CMAKE_CURRENT_BINARY) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)

#---------------------------------------------------------
# dependencies
#

cmake.check_depends:
@echo "Building dependencies cmake.check_depends..."
$(CMAKE_COMMAND) -S$(CMAKE_CURRENT_SOURCE) -O$(CMAKE_CURRENT_BINARY) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)

#---------------------------------------------------------
# dependencies
#

depend: $(SUBDIR_DEPEND)
@echo "Building dependencies depend..."
$(CMAKE_COMMAND) -S$(CMAKE_CURRENT_SOURCE) -O$(CMAKE_CURRENT_BINARY) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)

#---------------------------------------------------------
# dependencies
#

dependlocal:
@echo "Building dependencies dependlocal..."
$(CMAKE_COMMAND) -S$(CMAKE_CURRENT_SOURCE) -O$(CMAKE_CURRENT_BINARY) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)

#---------------------------------------------------------
# CMakeCache.txt
#

rebuild_cache: $(CMAKE_BINARY_DIR)/CMakeCache.txt
@echo "Building CMakeCache.txt rebuild_cache..."
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)

#---------------------------------------------------------
# CMakeCache.txt because out-of-date:
#

/home/cv/sordas/sandres/BaseLib/cmake.check_cache: /home/cv/sordas/sandres/BaseLib/CMakeCache.txt
/home/cv/sordas/sandres/BaseLib/cmake.check_cache: $(CMAKE_MAKEFILE_SOURCES)
@echo "Building CMakeCache.txt because out-of-date: /home/cv/sordas/sandres/BaseLib/cmake.check_cache..."
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)

#---------------------------------------------------------
# edit CMakeCache.txt
#

edit_cache:
@echo "Building edit CMakeCache.txt edit_cache..."
$(CMAKE_EDIT_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)

#---------------------------------------------------------
# CMakeCache.txt
#

$(CMAKE_BINARY_DIR)/CMakeCache.txt:
@echo "Building CMakeCache.txt $(CMAKE_BINARY_DIR)/CMakeCache.txt..."
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)

#---------------------------------------------------------
# Rule to keep make from removing Makefiles if control-C is hit during a run of cmake.
#

.PRECIOUS: Makefile cmake.depends

# Rules to build .o files from their sources:
ARGS=
#---------------------------------------------------------
# tests
#

test:
@echo "Building tests test..."
/extra/local/bin/ctest $(ARGS)

INSTALL = "/extra/local/share/CMake/Templates/install-sh" -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
install: $(SUBDIR_INSTALL)
@echo "Installing ..."
include cmake.depends

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 »

Unfortunately this does not really help. When I asked you for a "minumum example" I was thinking of a small piece of code (essentially a complete C++ source file with a main function) and a simple Makefile (not a "complex" one as created by CMake).

Here is what I meant:

Code: Select all

// file "test.cc"

#include "osconfig.h"
#include "dctk.h"

int main(int argc, char *argv[])
{
    DcmFileFormat file;
    if (argc > 0)
    {
        OFCondition status = file.loadFile(argv[1]);
        COUT << argv[1] << ": " << status.text() << endl;
    }
}

Code: Select all

# Makefile for "test"

SHELL = /bin/sh
VPATH = ../include:../../config/include
srcdir = .
top_srcdir = ..
configdir = ../../config

include $(configdir)/Makefile.def

LOCALINCLUDES = -I$(top_srcdir)/../ofstd/include -I$(top_srcdir)/../dcmdata/include
LIBDIRS = -L$(top_srcdir)/../ofstd/libsrc -L$(top_srcdir)/../dcmdata/libsrc
LOCALLIBS = -ldcmdata -lofstd $(ZLIBLIBS)

test: test.o
	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBDIRS) -o $@ $@.o $(LOCALLIBS) $(MATHLIBS) $(LIBS)
This can be compiled and executed without any problems on our Linux system (gcc 3.2). The files are e.g. located in "dcmtk-3.5.3/test/apps".

Just try it out.

sandres
Posts: 4
Joined: Wed, 2004-12-22, 17:41

#7 Post by sandres »

I tested your code, and it compiles.

The problem is when I use the Makefile generated by CMake.
In this file the dcmtk include dirs are defined as:

Code: Select all

SET(DCMTK_INCLUDE_DIRECTORIES
		${DCMTK_PATH}/config/include
		${DCMTK_PATH}/dcmdata/include
		${DCMTK_PATH}/dcmimgle/include
		${DCMTK_PATH}/ofstd/include
)

INCLUDE_DIRECTORIES( ${DCMTK_INCLUDE_DIRECTORIES} )
DCMTK_PATH is "$HOME/sandres/dcmtk-3.5.3" in my case.

So, these directories should be added as include directories to build the libray. Should I include other directories??

In Windows, it works only with these.

I hope you can help me.

Best,
Sergio.

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1444
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#8 Post by Marco Eichelberg »

The directories seem to be OK. You should check if there is a header file named "cfunix.h" somewhere on your system that might be loaded by the preprocessor instead of the file in ${DCMTK_PATH}/config/include. All results of DCMTK's configure tests are stored in this file as preprocessor #define directives, and a wrong "version" of this file would exactly explain your problem. It should be possible to check this by manually creating a syntax error in the file (something like "#error") and trying to re-compile.

dhavaldalal
Posts: 3
Joined: Wed, 2005-03-02, 02:27

#9 Post by dhavaldalal »

hi sandres
i was wondering if you had found the solution to your problem.
Even i am writing an application that uses itk and dcmtk.
I get the following error
"/usr/local/dcmtk-3.5.3/ofstd/include/ofstream.h:76:2: #error DCMTK needs stringstream or strstream type"
My code compiles under windows with no problem.
i just face this error in gcc 3.2.3

Thanks
Dhaval

edoto
Posts: 3
Joined: Wed, 2005-08-31, 02:24
Location: Tokyo, JAPAN

Makefile Question

#10 Post by edoto »

Hallo Jörg,

In the Makefile you provided (below) you set the top_srcdir, configdir, etc
to the DCMTK build directory, but how about when you have the /lib /include and others under your /usr/ directory? I have tried several times to use them but I haven't been able to complie or link them. It only works when I use a the Make info in the build directory, and it makes using other libraries difficult. Can you give me some suggestions?
[quote="Jörg Riesmeier"]

Code: Select all

# Makefile for "test"

SHELL = /bin/sh
VPATH = ../include:../../config/include
srcdir = .
top_srcdir = ..
configdir = ../../config

include $(configdir)/Makefile.def

LOCALINCLUDES = -I$(top_srcdir)/../ofstd/include -I$(top_srcdir)/../dcmdata/include
LIBDIRS = -L$(top_srcdir)/../ofstd/libsrc -L$(top_srcdir)/../dcmdata/libsrc
LOCALLIBS = -ldcmdata -lofstd $(ZLIBLIBS)

test: test.o
	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBDIRS) -o $@ $@.o $(LOCALLIBS) $(MATHLIBS) $(LIBS)

Danke fuer deine Hilfe.

Edgar

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

#11 Post by Jörg Riesmeier »

Why don't you just change the directory settings in the makefile? I'm sorry but I can't see any problem ...

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest