## -*-text-*- ## ## Building the OFFIS DICOM toolkit under MacOSX Server 1.2 ## ## provided by Bernd Kümmerlen (bkuemmer@mevis.de) # $Id: HowToBuildDcmtkOnMacOSX.txt,v 1.1 2001/06/14 15:22:16 meyer Exp $ # $Source: /people/staff2/meyer/.cvsroot/public_html/dcmtk/HowToBuildDcmtkOnMacOSX.txt,v $ Trying to compile dcmtk-341 on MacOSX Server Machine: Power Macintosh G4 OS: MacOSX Server 1.2 (Rhapsody 5.6) Compiler: gcc-2.7.2.1 [floyd:~/tmp] bkuemmer% uname -a Rhapsody floyd 5.6 Kernel Release 5.6: Tue Nov 23 15:07:38 PST 1999; root(rcbuilder):Objects/kernel-187.obj~2/RELEASE_PPC Copyright (c) 1988-1995,1997-1999 Apple Computer, Inc. All Rights Reserved. Power Macintosh [floyd:~/tmp] bkuemmer% cc -v Reading specs from /usr/libexec/ppc/2.7.2.1/specs Apple Computer, Inc. version cc-783.1, based on gcc version 2.7.2.1 * Step 1: cd config ./rootconf cd .. No problem here * Step 2: ./configure Apparently no problem here as well * Step 3: make all - leads to: (cd apps; make ARCH="" all) c++ -DHAVE_CONFIG_H -DNDEBUG -c -I. -I. -I../include -I../../config/include -I../include -I../../ofstd/include -I../../dcmdata/include \ -g -Wall ./dconvlum.cc c++ -g -Wall -L../libsrc -L../../dcmdata/libsrc -L../../ofstd/libsrc -L/usr/local/dicom/lib -o dconvlum ./dconvlum.o -ldcmimgle -ldcmdata -lofstd -lm -lg++ /usr/bin/ld: can't locate file for: -lm make[2]: *** [dconvlum] Error 1 make[1]: *** [apps-all] Error 2 make: *** [dcmimgle-all] Error 2 Hmm, CHANGES.340 says this: - Linking -lm to dcmimgle/apps, required on OSF1. Affects: dcmimgle/apps/Makefile.in -> change in dcmimgle/apps/Makefile.in #LOCALLIBS = -ldcmimgle -ldcmdata -lofstd -lm # bk20000508: removed -lm for MacOSX LOCALLIBS = -ldcmimgle -ldcmdata -lofstd * repeat Step2, * Step3 make all - leads to: (cd apps; make ARCH="" all) c++ -DHAVE_CONFIG_H -DNDEBUG -c -I. -I. -I../include -I../../config/include -I../../dcmpstat/include -I/usr/local/dicom/include/dcmpstat -I../../ofstd/include -I/usr/local/dicom/include/ofstd -I../../dcmnet/include -I/usr/local/dicom/include/dcmnet -I../../dcmdata/include -I/usr/local/dicom/include/dcmdata -I../../dcmimgle/include -I/usr/local/dicom/include/dcmimgle -I../../imagectn/include -I/usr/local/dicom/include/imagectn \ -g -Wall ./dcmpsmk.cc c++ -g -Wall -L../libsrc -L../../dcmpstat/libsrc -L../../imagectn/libsrc -L../../dcmnet/libsrc -L../../dcmdata/libsrc -L../../ofstd/libsrc -L../../dcmimgle/libsrc -L/usr/local/dicom/lib -o dcmpsmk ./dcmpsmk.o -ldcmpstat -ldcmimgle -limagedb -ldcmnet -ldcmdata -lofstd -lm -lg++ /usr/bin/ld: can't locate file for: -lm make[2]: *** [dcmpsmk] Error 1 make[1]: *** [apps-all] Error 2 make: *** [dcmpstat-all] Error 2 - > see above (change in dcmpstat/apps/Makefile.in) * repeat Step2 * Step 3 make all - leads to: c++ -DHAVE_CONFIG_H -DNDEBUG -c -I. -I. -I../include -I../../config/include -I../../dcmpstat/include -I/usr/local/dicom/include/dcmpstat -I../../ofstd/include -I/usr/local/dicom/include/ofstd -I../../dcmnet/include -I/usr/local/dicom/include/dcmnet -I../../dcmdata/include -I/usr/local/dicom/include/dcmdata -I../../dcmimgle/include -I/usr/local/dicom/include/dcmimgle -I../../imagectn/include -I/usr/local/dicom/include/imagectn \ -g -Wall ./dcmprtsv.cc In file included from /usr/include/dirent.h:67, from ./dcmprtsv.cc:43: /usr/include/sys/dirent.h:76: syntax error before `;' /usr/include/sys/dirent.h:77: syntax error before `;' /usr/include/sys/dirent.h:78: syntax error before `;' /usr/include/sys/dirent.h:79: syntax error before `;' make[2]: *** [dcmprtsv.o] Error 1 make[1]: *** [apps-all] Error 2 make: *** [dcmpstat-all] Error 2 The problem seems to be that dcmprtsv.cc directly includes /usr/include/dirent.h without having included the correct types.h -> change in dcmpstat/apps/dcmprtsv.cc #include "osconfig.h" /* make sure OS specific configuration is included first */ /* bk20000508: this makes sure the correct types.h is included (was needed for inclusion of ) */ #include "dcompat.h" => "make all" succeeds All tools seem to work (tested imagectn, storescu, storescp, echoscu, dcmdump, dump2dcm). Note: The default endianness on the Mac is BigEndianExplicit. It might be good to force LittleEndianImplicit...