calling the OPENSSL libs in windows mobile

20 篇文章 0 订阅
14 篇文章 0 订阅

1.    Steps to new a application
    a)    New a smart device project
    b)    Add additional include directory: ../celib; ../celib/openssl; ../celib/include;    The last path is where the wcecompat h file stored.
    c)    Add additional dependencies: ../celib/ssleay32.lib ../celib/libeay32.lib
    d)    Copy the libeay32.dll, libeay32.lib, ssleay32.lib and ssleay32.dll into working directory.
    e)    Include any .h file needed from OPEN SSL
    f)    Just call the functions in OPEN.
    g)    According to your CE SDK, choose debugger to launch.

2.    error shooting
a)    link error:
    i.    xxx already defined in LIBCMTD.lib.
        ignore the lib, by opening the property page, add the lib into Linker—Input—Ignore Specific Library.
    ii.    abs is not defined.
        Abs comes out... more exercises are needed.
        Add head file: #include <math.h>

b)    deploy error, not enough disk space
    well, we can debug the exe in the Storage card. Just change the two setting:
    Debugging—Remote Executable: 存储卡/...
    Deployment—Remote Directory:  存储卡/...
    The path maybe different, check your cell phone.

c)    deploy OK, when run the exe error with code 0x8007007e: don’t have certain needed DLL with in the directory.
If it’s a MFC application, those DLL is needed:
    MFC80UD.dll
    atl80.dll
    msvcr80.dll
    msvcr80d.dll
    libeay32.dll
    ssleay32.dll
    Make sure all the Dll file is in the same directory of the exe file.

d)    Use static OPEN lib in win application.
    All the process abobve we use the DLL edition, if you are using the static lib of OPEN, you will also need to include libs: ../celib/wcecompat.lib  ../celib/wcecompatex.lib
    But the lib wcecompat doesn’t support win application to call the static OPEN lib yet, we may confront the compiling error message: “Error    1    error LNK2019: unresolved external symbol main referenced in function WinMain    wcecompat.lib”
    if we still need to link the static lib, we need to rebuild the wcecompat.lib.
        open the file “makefile” and delete the line 20: “src/winmain.cpp                /”.
        rebuild.
    With the new lib we can call the static OPEN lib in win application.

e)    What I understand of these errors is that linker could not find definitions of following variables/functions in the library:
    1. _abort
    2. __iob
    3. __pctype
    4. __errno
    5. ___mb_cur_max
    6. __isctype
    7. __aulldiv
    8. __aullrem
    9. __allmul
    This matters because other lib links against openssl.
    the generated makefiles for Win32 hard code /MD into the compiler flags. This causes the link with your program to want the DLL runtime. (Note your error messages that mention dllimport.)You may edit ms/nt.mak after you run the configure. Find the line that begins with: CFLAG= /MD Change the /MD to something better, like /MT (multithreaded using LIBCMT.lib) or /ML (single threaded using LIBC.lib). Whatever you choose here must be the same as what you use for your program that links against this library.
    Now run the make and the install and try linking to your program.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值