I have a problem to compile with dcmtk. I would like to try this test program (This program, that I found on the website, is useless but I try to compile it before to continue.):
Code: Select all
#include <iostream>
#include "dcmtk\dcmimgle\dcmimage.h"
using namespace std;
int main(int argc, char* argv[]) {
DicomImage *image = new DicomImage("test.dcm");
if (image != NULL)
{
if (image->getStatus() == EIS_Normal)
{
if (image->isMonochrome())
{
image->setMinMaxWindow();
Uint8 *pixelData = (Uint8 *)(image->getOutputData(8 /* bits */));
if (pixelData != NULL)
{
/* do something useful with the pixel data */
}
}
} else
cerr << "Error: cannot load DICOM image (" << DicomImage::getString(image->getStatus()) << ")" << endl;
}
delete image;
}
Code: Select all
# Makefile for "test"
SHELL = /bin/sh
VPATH = ./config/include
srcdir = .
top_srcdir = ..
configdir = ./config
include ./config/Makefile.def
LOCALINCLUDES = -Iofstd/include -Idcmdata/include -Idcmimgle/include
LIBDIRS = -Lofstd/libsrc -Ldcmdata/libsrc -Ldcmimgle/libsrc
LOCALLIBS = -ldcmimgle -ldcmdata -lofstd $(ZLIBLIBS)
PROGS = test
all: $(PROGS)
test: test.o
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBDIRS) -o $@ $(LOCALLIBS) $(MATHLIBS) $(LIBS)
test.o: test.cc ./dcmimgle/include/dcmtk/dcmimgle/dcmimage.h
I use cygwin (UNIX emulator) with Windows XP.
The compiler that I use is the gcc 3.4.4
Each time, I receive an error message like this:
Code: Select all
$ make
c++ -O -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE
-D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L -Wall -Lofstd/libsrc -Ld
cmdata/libsrc -Ldcmimgle/libsrc -o test -ldcmimgle -ldcmdata -lofstd -lz -lm -lp
thread -lwsock32
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o):(.text+0xab):
undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status
make: *** [test] Error 1
Thank you.