executing in xCode, serious problems in Mac Os X!!

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
esmitt
Posts: 4
Joined: Tue, 2007-10-16, 02:44
Location: caracas
Contact:

executing in xCode, serious problems in Mac Os X!!

#1 Post by esmitt »

Hi,
i installed dcmtk following the steps in the installation guides (zlib, tiif, libxml, libpng, tcp_wrappers and libicinv) for MacOs X.
In /usr/local/dicom exists bin, etc, include, lib, man and share subdirectory. I suppose that all is correct.
When i write a test code in Xcode IDE:

Code: Select all

#ifndef HAVE_CONFIG_H
#define HAVE_CONFIG_H

#include "dcmtk/config/osconfig.h" 
#include "dcmtk/ofstd/oftypes.h" 
#include "dcmtk/dcmdata/dctk.h" 
#include <iostream>

int main (int argc, char * const argv[]) {

	DcmFileFormat fileformat;
    std::cout << "Hello, World!\n";
    return 0;
}
#endif
The compilation is 0 errors and warning but the execution crash! the message is:

Code: Select all

[Session started at 2007-10-16 12:11:02 -0400.]
ZeroLink: unknown symbol '__ZN13DcmFileFormatC1Ev'
I change the option ZeroLink in Build Options and the same result.
If you can help me....maybe my installation process is wrong but i don't know how verify that. I have installed the software as 4 or 5 times!!!!

Thanks in advance


p.d.: my OS is version 10.4.10 in a Mac based Intel
esmitt ramirez j.

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

#2 Post by Michael Onken »

Hi,

I also think this is link problem in Xcode due to wrong configuration. Be sure to link at least the DCMTK libraries ofstd and dcmdata to your project.

If DCMTK builds correctly on the console it is very unlikely that the problem lies within the toolkit.

Regards,
Michael

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

#3 Post by Per »

Are you compiling the program as C++ code (set with the suffix .cpp rather than .c)?

esmitt
Posts: 4
Joined: Tue, 2007-10-16, 02:44
Location: caracas
Contact:

Xcode problem

#4 Post by esmitt »

Thanks...
I will review the link to the dcmtk library... it's my first steps in Mac!!! and in xCode too.
The file is a .cpp extension. I shall try to make the compiled without use xCode (emacs or vi editor)

Thanks...
esmitt ramirez j.

esmitt
Posts: 4
Joined: Tue, 2007-10-16, 02:44
Location: caracas
Contact:

again

#5 Post by esmitt »

Hi, i executing in the terminal with my file main.cpp and the default output a.out. Mi dicom libraries are in /usr/local/dicom...

Code: Select all

g++ main.cpp -I/usr/local/dicom/include/ -L/usr/local/dicom/lib/libdcmdata.a -L/usr/local/dicom/lib/libdcmnet.a -L/usr/local/dicom/lib/libdcmdsig.a -L/usr/local/dicom/lib/libdcmimage.a -L/usr/local/dicom/lib/libdcmimgle.a -L/usr/local/dicom/lib/libdcmjpeg.a -L/usr/local/dicom/lib/libdcmpstat.a -L/usr/local/dicom/lib/libdcmqrdb.a -L/usr/local/dicom/lib/libdcmsr.a -L/usr/local/dicom/lib/libdcmtls.a -L/usr/local/dicom/lib/libdcmwlm.a -L/usr/local/dicom/lib/libijg12.a -L/usr/local/dicom/lib/libijg16.a -L/usr/local/dicom/lib/libijg8.a -L/usr/local/dicom/lib/libofstd.a
...and nothing
if you can help me about this..

thanks in advance[/code]
esmitt ramirez j.

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

#6 Post by Marco Eichelberg »

Before calling your post "serious problems in Mac Os X" you might want to read the manual page in the future. The -L option specifies a link directory in g++, -l with lowercase l specifies a library to link against. Also note that link order is significant and probably wrong in your example - there is some FAQ that explains the library dependencies; libraries need to be specified in reverse order of dependency, i.e. typically -ldcmdata -lofstd are the last DCMTK link statements. You can also see this in the various DCMTK makefiles.

esmitt
Posts: 4
Joined: Tue, 2007-10-16, 02:44
Location: caracas
Contact:

maybe

#7 Post by esmitt »

Ok, maybe it's not a correct title for my post, sorry for that and i thanks for your recommendations.
esmitt ramirez j.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest