Re: [Gdcm2] gdcmcharls link errors when doing static MSVC build (showstopper!)
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Mark R. <mm...@gm...> - 2011-01-02 15:13:48
|
Hi Niels, Are you using the charls from the git repository, or from the 2.0.16 source? I just moved our charls implementation to something more recent from the developer to support ITK streaming, but that may have messed with the export symbols you're requiring as he changed around his header files. Because it's not our library, i"m a bit hesitant to put a gdcm-specific definition in there. He's working on further improvements that we'll need in order to truly implement streaming, so those files aren't locked down now, meaning that I'll be updating the charls files shortly. If you're not using the git master, then could you check that one and see if it meets your needs? I believe it has a cmake switch to indicate whether charls should be built static or not. Mark On Sun, Jan 2, 2011 at 3:56 AM, Niels Dekker - address until 2014 <nie...@xs...> wrote: > We usually statically link GDCM to our application > (GDCM_BUILD_SHARED_LIBS=OFF), using MSVC; Unfortunately I'm currently > getting link errors when I try to build GDCM statically (see PS). I think > the errors are caused by the definitions of CHARLS_IMEXPORT; I think they > should be as follows: > > In gdcmcharls/interface.h: >> >> #if defined(WIN32) && defined(GDCM_BUILD_SHARED_LIBS) >> #ifndef CHARLS_IMEXPORT >> #define CHARLS_IMEXPORT(returntype) __declspec(dllimport) returntype >> __stdcall >> #endif >> #else >> #ifndef CHARLS_IMEXPORT >> #define CHARLS_IMEXPORT(returntype) returntype >> #endif >> #endif /* _WIN32 */ > > And in gdcmcharls/interface.cpp: >> >> #if defined(_WIN32) && defined(_WINDLL) >> #define CHARLS_IMEXPORT(returntype) __declspec(dllexport) returntype >> __stdcall >> #else >> #define CHARLS_IMEXPORT(returntype) returntype >> #endif > > See also the attached patch. Note that this issue would probably stop us > from upgrading to GDCM 2.0.17. > > Kind regards, Niels > > PS The link errors are as follows: >> >> gdcmMSFF.lib(gdcmJPEGLSCodec.obj) : error LNK2019: unresolved external >> symbol __imp__JpegLsReadHeader@12 referenced in function "public: virtual >> bool __thiscall gdcm::JPEGLSCodec::GetHeaderInfo(class >> std::basic_istream<char,struct std::char_traits<char> > &,class >> gdcm::TransferSyntax &)" >> (?GetHeaderInfo@JPEGLSCodec@gdcm@@UAE_NAAV?$basic_istream@DU?$char_traits@D@std@@@std@@AAVTransferSyntax@2@@Z) >> gdcmMSFF.lib(gdcmJPEGLSCodec.obj) : error LNK2019: unresolved external >> symbol __imp__JpegLsDecodeRect@36 referenced in function "public: bool >> __thiscall gdcm::JPEGLSCodec::Decode(class gdcm::DataElement const &,char >> *,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned >> int,unsigned int)" >> (?Decode@JPEGLSCodec@gdcm@@QAE_NABVDataElement@2@PADIIIIIII@Z) >> gdcmMSFF.lib(gdcmJPEGLSCodec.obj) : error LNK2019: unresolved external >> symbol __imp__JpegLsDecode@20 referenced in function "public: virtual bool >> __thiscall gdcm::JPEGLSCodec::Decode(class gdcm::DataElement const &,class >> gdcm::DataElement &)" >> (?Decode@JPEGLSCodec@gdcm@@UAE_NABVDataElement@2@AAV32@@Z) >> gdcmMSFF.lib(gdcmJPEGLSCodec.obj) : error LNK2019: unresolved external >> symbol __imp__JpegLsEncode@24 referenced in function "public: virtual bool >> __thiscall gdcm::JPEGLSCodec::Code(class gdcm::DataElement const &,class >> gdcm::DataElement &)" >> (?Code@JPEGLSCodec@gdcm@@UAE_NABVDataElement@2@AAV32@@Z) > > -- > Niels Dekker > http://www.xs4all.nl/~nd/dekkerware > Scientific programmer at LKEB, Leiden University Medical Center > > ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, > and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Gdcm-developers mailing list > Gdc...@li... > https://lists.sourceforge.net/lists/listinfo/gdcm-developers > > |