[Dcmlib] new to gdcm-cmake problems with test example
Ashish Singh
mrasingh at gmail.com
Fri Aug 31 23:29:42 CEST 2007
Hi Jean-Pierre,
Thanks for replying. I figured it out. I used-TARGET_LINK_LIBRARIES(gdcmex1
GDCM) and it worked fine, I was able to build and run the code.
I also tried your suggestion of-TARGET_LINK_LIBRARIES(gdcmex1
GDCM_LIBRARIES), it gives another error as follows-
LINK : fatal error LNK1104: cannot open file 'GDCM_LIBRARIES.lib'
Yes, I have posted before on VTK,ITK,Qt and KWWIdget forums. These are the
libraries I mostly use. I wrote a simple dicom anonymizer application
recently using ITK and Qt. If you read some of my recent posts on ITK, then
you may know that I was running into a lot of memory problems using it on
our dataset here. I was running my anonymizer application on a dataset of
250,000 dicom images, all of different modality and studies. The application
would run fine till about 70,000 images and then would give error. I
couldn't catch the cause of error there. That's when I thought of switching
to GDCM. So to answer your 2nd question, as of now I will be just using GDCM
with Qt ,but as we go ahead yes I will want to use GDCM, ITK, VTK, QT etc.
all together. If there are any special settings that I will have to do now,
I would really appreciate if you could let me know.
I guess GDCM library is a part of ITK library, right? please correct me if
I am wrong here. In that case, all the GDCM classes and their members should
be available if I have ITK. If this is the case, how do I access all these
classes and their members from ITK itself?
Btw, I did not download the CVS version, I don't know how to download the
CVS version(not familiar with CVS), I just downloaded the zip file(gdcm
1.3.1) from the download page.
Thanks,
Ashish
On 8/31/07, Jean-Pierre ROUX <jean-pierre.roux at creatis.univ-lyon1.fr> wrote:
>
> >Hi,
> >
> >I just installed GDCM library on my windows XP Pro X64 workstation
> >and compiled it with CMAKE and later built the generated solution
> >using VS 2005 Pro. All this went fine without any errors. However I
> >am not sure what my cmakelists.txt file should look like to test a
> >simple example. I created a cmakelists.txt file which looks like-
> >--------
> >PROJECT(gdcmex1)
> >
> >FIND_PACKAGE(GDCM)
> >IF(GDCM_FOUND)
> > INCLUDE(${GDCM_USE_FILE})
> >ENDIF(GDCM_FOUND)
> >
> >ADD_EXECUTABLE(gdcmex1 myex1.cpp)
> >
> ># I am not sure about the following line, what other libraries do I
> >need to specify here?
> >TARGET_LINK_LIBRARIES(gdcmex1)
>
>
>
> Hi, Ashish.
>
> --> Try
> TARGET_LINK_LIBRARIES(gdcmex1 GDCM_LIBRARIES)
>
> --> Just a question :
> I saw some previous posts from you, on "Insight-users" mailing list.
> Do you want to use gdcm1.3 (CVS version) alone, or concurently with
> gdcm1.2 (ITK version)
>
> (The 2nd possibility doesn't go straight forward ...)
>
> Jean-Pierre Roux
>
>
> >----------
> >
> >My test example code looks like-
> >----------------------
> >/* myex1.cpp*/
> >#include "gdcmFile.h"
> >#include "gdcmFileHelper.h"
> >#include <iostream>
> >
> >using namespace std;
> >
> >int main(int argc, char *argv[])
> >{
> > int i=0;
> > cout<<i<<endl;
> > std::string fileName;
> >
> > gdcm::File *e1;
> > e1=gdcm::File::New();
> >
> > return 0;
> >}
> >--------------------
> >Visual Studio 2005 Pro gives me the following errors on this simple
> example.
> >
> >-------
> >1>myex1.obj : error LNK2019: unresolved external symbol
> >"__declspec(dllimport) public: static class gdcm::File * __cdecl
> >gdcm::File::New(void)" (__imp_?New at File@gdcm@@SAPAV12 at XZ) referenced
> >in function _main
> >1>Debug\gdcmex1.exe : fatal error LNK1120: 1 unresolved externals
> >-------
> >
> >Can anyone please guide me as to what I am missing here and how to fix
> it?
> >
> >Thanks in advance,
> >Ashish
> >
> >
> >_______________________________________________
> >Dcmlib mailing list
> >Dcmlib at creatis.insa-lyon.fr
> >http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib
>
> Jean-Pierre ROUX
> CREATIS - CNRS UMR 5220, INSERM U 630
> Laboratoire de Radiologie Experimentale
> Hopital Cardiologique
> 28 Avenue du Doyen LEPINE
> B.P. Lyon-Montchat
> 69394 Lyon Cedex 03
>
> Tel : (+33) 04 72 35 74 12
> Fax : (+33) 04 72 68 49 16
> URL : http://www.creatis.univ-lyon1.fr
> e-mail : jpr at creatis.univ-lyon1.fr/~jpr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/dcmlib/attachments/20070831/f0f008c3/attachment.html>
More information about the Dcmlib
mailing list