[Insight-users] dllimport error gdcm under visual studio...

Neil.Burdett at csiro.au Neil.Burdett at csiro.au
Thu Jan 28 23:21:47 EST 2010


Hi Luis,
         yes I have ITKIO in my Cmakelist.txt file, and in visual studio linker options I can see for example one of the libraries being itkgdcm.lib.

B) I'm using the gdcm that comes as part of itk 3.12 (as that's what we have on our Ubuntu build)

I have a workaround that enables my code to built. I basically remove the "GDCM_EXPORT" macro from C:\src-itk-3.12.0\Utilities\gdcm\src\gdcmDicomDir.h file so it looks like this now; "class DicomDir: public Document"

Not a very elegant solution as I was hoping it would work without any changes...

Cheers
Neil

-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez at kitware.com] 
Sent: Friday, 29 January 2010 7:16 AM
To: Burdett, Neil (ICT Centre, Herston - RBWH)
Cc: insight-users at itk.org
Subject: Re: [Insight-users] dllimport error gdcm under visual studio...

Hi Neil,

A) Are you adding "ITKIO" to the list of libraries to link with ?
     That should bring in "gdcm"

B) Are you using a "system gdcm" or the one that comes with ITK ?


Please let us know,

      Thanks

          Luis

---------------------------------
On Wed, Jan 27, 2010 at 5:02 PM,  <Neil.Burdett at csiro.au> wrote:
> Hi,
>
>      I was wondering if anyone could help me with the following errors I
> get;
>
>
>
> milxDicomLoader.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: void __thiscall
> gdcm::DicomDir::SetDirectoryName(class std::basic_string,class
> std::allocator > const &)"
> (__imp_?SetDirectoryName at DicomDir@gdcm@@QAEXABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@Z)
> referenced in function "public: class milx::milxImageGroup * __thiscall
> milx::milxDicomLoader::LoadDir(class wxString const &)"
> (?LoadDir at milxDicomLoader@milx@@QAEPAVmilxImageGroup at 2@ABVwxString@@@Z)
>
> milxDicomLoader.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: float __thiscall
> gdcm::DicomDir::GetProgress(void)const "
> (__imp_?GetProgress at DicomDir@gdcm@@QBEMXZ) referenced in function "void
> __cdecl milx::milxDicomDirProgress(void *)"
> (?milxDicomDirProgress at milx@@YAXPAX at Z)
>
> C:\milx-view\build\lib\Debug\milx-lib.dll : fatal error LNK1120: 2
> unresolved externals
>
>
>
>
>
> The code builds okay under Linux, but I get the above error on visual studio
> 2008.
>
>
>
> The code is quite straight forward;
>
>
>
>
>
> milxImageGroup *milxDicomLoader::LoadDir( const wxString &dirName )
>
> {
>
>       gdcm::DicomDir *dir = new gdcm::DicomDir();
>
>       ProgressArgs args = { this, dir };
>
>       std::string stldirName(dirName.ToAscii());
>
>       dir->SetDirectoryName( stldirName );
>
>       dir->SetProgressMethod( milxDicomDirProgress, &args );
>
>       dir->ParseDirectory();
>
>       dir->SetProgressMethod(NULL);
>
>       return new milxImageGroup(dirName, dir);
>
> }
>
>
>
> So I assume its a configuration issue? Any help would be much appreciated
>
>
>
> Neil
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list