Monday 17 March 2008

CxImage 使用安装 VS2005


首先要修正源代码的一些错误


以下两个地方需要改正:


1、
\cximage\cximage\ximatran.cpp(174)   :   error   C2666:   'div '   :   2   overloads   have   similar   conversions
\vc\include\stdlib.h(508):   could   be   'ldiv_t   div(long,long) '
                d:\vs8\vc\include\stdlib.h(482):   or   'div_t   div(int,int) '


div的参数强制转换为long 就可以了


2、


for(int i=....)


在VS2005里面, for循环体里面定义 只在循环体内有效,所以会出现一些i 没有定义的问题



然后把所有生成的Lib最好都放到一个文件夹下,方便使用


我是放到


E:\lib\release
E:\lib\debug


这是官方的帮助对在自己的工程中使用CxImage类库的说明:


Project Settings
|- C/C++
|   |- Code Generation
|   |   |- Use run-time library : Multithreaded DLL (must be the same for
|   |   | all the linked libraries)
|   |   |- Struct member alignment : must be the same for all the linked
|   |   | libraries
|   |- Precompiled headers : not using precompiled headers
|   |- Preprocessor
|       |- Additional Include Directories: ..\cximage
|- Link
    |- General
        |- Object/library modules: ../png/Debug/png.lib
                                   ../raw/Debug/libdcr.lib
                                   ../jpeg/Debug/jpeg.lib
                                   ../zlib/Debug/zlib.lib
                                   ../tiff/Debug/tiff.lib
                                   ../jasper/Debug/jasper.lib
                                   ../cximage/Debug/cximage.lib ...
                                  
                                  
首先:


选项->工具->项目和解决方案->VC++目录


库文件: 增加 :   E:\lib\release   E:\lib\debug


包含文件: 增加: (your CxImage dir)\CxImage



然后在你的工程中:


项目->属性->配置属性->链接器->输入->附加依赖项 : 增加:


cximage.lib jpeg.lib png.lib tiff.lib j2k.lib jasper.lib jbig.lib zlib.lib


在 项目->属性->配置属性->常规


MFC使用: 在共享DLL中使用MFC


字符集: 使用多字节字符集


在项目->属性->配置属性->C/C++->代码生成


运行时库 : /MD
结构成员对齐: 16字节


预编译头:不使用预编译头


OK,这样子,就可以开始使用CxImage啦





No comments:

Post a Comment