搞了两三天dng_sdk 程序,总算是搞定了,主要是validate程序,我用的是win7系统,VS2010,x64编译平台,方法如下:
1.dng_sdk下载网址:http://helpx.adobe.com/photoshop/digital-negative.html, DNG SDK win,解压缩后dng_sdk、JPEG_ReadMe.txt、XMP_ReadMe.txt三个文件;
2.按JPEG_ReadMe.txt文件里面的说明下载解压,重命名文件,与dng_sdk做兄弟文件;
3.按XMP_ReadMe.txt说明下载解压重命名文件,同样与dng_sdk做兄弟文件,编译方法参照上一篇博客文章,在上一篇博客文件编译的基础上需要编译XMPCore和XMPFiles两个工程的静态和动态库:
XMPCore:xmp-sdk XMPCore build vc10 dynamic windows_x64 打开XMPCore64.sln 工程编译会在../xmp_sdk\public\libraries\windows_x64\Debug中生成相应.dll和.lib库
XMPFiles: xmp_sdk\XMPFiles\build\vc10\dynamic\windows_x64打开XMPFiles64.sln工程编译也会在../xmp_sdk\public\libraries\windows_x64\Debug中生成相应.dll和.lib库
4.至此准备工作做完了,打开\dng_sdk\projects\win\dng_sdk.sln工程,会出现Microsoft Visual Studio提示的未能正确加载解决方案中的一个或多个项目。有关详细信息,请参见“输出”窗口,直接确定就行了,输出窗口会出现D:\DNGcode\xmp_sdk\build\vc\XMPFiles.vcxproj : error : 未能找到项目“D:\DNGcode\xmp_sdk\build\vc\XMPFiles.vcxproj”。
D:\DNGcode\xmp_sdk\build\vc\XMPFiles.vcxproj : error : 未能找到项目“D:\DNGcode\xmp_sdk\build\vc\XMPCore.vcxproj”。两个错误,本工程只编译validate,不用管它即可,编译程序,会出现如下错误:
5.缺少JCONFIG.H文件,在网站http://pan.baidu.com/share/link?shareid=1968959567&uk=858054856上下载添加在重新命名的libjpeg文件中即可
6.继续编译出现的错误为:
2>dng_image_writer.obj : error LNK2019: 无法解析的外部符号 compress2,该符号在函数 "protected: virtual void __cdecl dng_image_writer::WriteData(class dng_host &,class dng_ifd const &,class dng_stream &,class dng_pixel_buffer &,class AutoPtr<class dng_memory_block> &)" (?WriteData@dng_image_writer@@MEAAXAEAVdng_host@@AEBVdng_ifd@@AEAVdng_stream@@AEAVdng_pixel_buffer@@AEAV?$AutoPtr@Vdng_memory_block@@@@@Z) 中被引用
2>dng_read_image.obj : error LNK2019: 无法解析的外部符号 uncompress,该符号在函数 "protected: virtual void __cdecl dng_read_image::ReadTile(class dng_host &,class dng_ifd const &,class dng_stream &,class dng_image &,class dng_rect const &,unsigned int,unsigned int,unsigned int,class AutoPtr<class dng_memory_block> &,class AutoPtr<class dng_memory_block> &,class AutoPtr<class dng_memory_block> &)" (?ReadTile@dng_read_image@@MEAAXAEAVdng_host@@AEBVdng_ifd@@AEAVdng_stream@@AEAVdng_image@@AEBVdng_rect@@IIIAEAV?$AutoPtr@Vdng_memory_block@@@@55@Z) 中被引用
2>dng_xmp_sdk.obj : error LNK2019: 无法解析的外部符号 WXMPFiles_GetVersionInfo_1,该符号在函数 "public: static void __cdecl TXMPFiles<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::GetVersionInfo(struct XMP_VersionInfo *)" (?GetVersionInfo@?$TXMPFiles@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@SAXPEAUXMP_VersionInfo@@@Z) 中被引用
2>dng_xmp_sdk.obj : error LNK2019: 无法解析的外部符号 WXMPFiles_Initialize_2,该符号在函数 "public: static bool __cdecl TXMPFiles<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::Initialize(unsigned long,char const *,char const *)" (?Initialize@?$TXMPFiles@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@SA_NKPEBD0@Z) 中被引用
2>dng_xmp_sdk.obj : error LNK2019: 无法解析的外部符号 WXMPFiles_Initialize_1,该符号在函数 "public: static bool __cdecl TXMPFiles<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::Initialize(unsigned long)" (?Initialize@?$TXMPFiles@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@SA_NK@Z) 中