how to port libjpeg8c to window …

how to port libjpeg8c to window mobile platform
    - Ba_jian, Nanjing

The libjpeg8c already has Windows version, which could be directly build under
command line of windows.   You can use makefile.vc to create VC projects. 

To port it to windows mobile, also you can manually do like:
    1) create an windows mobile projects;
    2) drop all *.h, *.c files to that folder, and add them to the current project
    3)  remove all test app files, cdjpeg, cjpeg,djpeg, tranxxx.h/c, rdxxx.h/c, wdxxx.h/c, 
                                  example.c,...
    4)  remove almost all jmemxxxx.c, only left jmemnobs.c 
      ( since tmpfile() is not supported in wince, which is used by jmemansi.c)
    5)  #define NO_GETENV in "jmemmgr.c" because getenv() is not supported in Win CE.

(if you use jconfig.vc -> jconfig.h, looks like no such issue).

=======================================================================================
Appendix A: how to create static lib using visual studio
=======================================================================================
  1. “项目类型”窗格中,选择“Visual C++”下的“Win32”

  2. “模板”窗格中,选择“Win32 控制台应用程序”

  3. 为项目选择一个名称(例如 MathFuncsLib),并将该名称输入“名称”字段。 为解决方案选择一个名称(例如 StaticLibrary),并将该名称输入“解决方案名称”字段。

  4. 单击“确定”启动 Win32 应用程序向导。 “Win32 应用程序向导”对话框的“概述”页中,单击“下一步”

  5. “Win32 应用程序向导”“应用程序设置”页中,选择“应用程序类型”下的“静态库”

  6. “Win32 应用程序向导”“应用程序设置”页中,清除“附加选项”下的“预编译头”复选框。

  7. 单击“完成”创建项目。

=======================================================================================
Appendix B: potential issues
=======================================================================================

    1.   temfile() not find issue, use jmemnobs.c instead of jmemansi.c
   2.    getenv() not find issue, #define  NO_GETENV in jmemmgr.c
  3.   warning LNK1166: cannot adjust code at offset=0x00001000, rva=0x00001E74

         This is a potential issue, which could crash CPU in TI-chipset, like OMAP9xxxx, it should be
         safe in other ARM chipsets. To fix it:
         (1) enable function level linking, through project property/C++/Enable function level linking (/Gy), or
         (2) split a big function to several function, looks like difficut to identify which function, and change it.

        Detailed information for reference:


=======================================================================================
Appendix C: To use the lib
=======================================================================================
  1.  typically, you only need three or maybe 4 header files
          libjpeg.h, jerror.h, jconfig.h, jmorecfg.h
  2. you can directly add the libjpeg.lib through "additional lib files" in project property, or
          #pragma comment(lib, "./libjpeg.lib")
   to enable link the file.
 3. Potential compiling issue when a cpp file include a header file of C, the old
    style C declares a function without parameters, however C++ will meet error,
    just do like this, when include jpeglib header in your cpp file:

extern "C" {
   #ifdef FAR
   #undef FAR
   #endif
   
   #define JCONFIG_INCLUDED
   #include "jconfig.h" // you must firstly include jconfig.h, 
                // then define HAVE_PROTOTYPES, --> caused by a bad configure, :-P
   #define HAVE_PROTOTYPES
   #include "jpeglib.h"
   #include "jerror.h"
   #include "jmorecfg.h"

   }



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值