环境 :VS2005+Perl +EVC4.0+wince6.0
仿照博客:http://blog.csdn.net/sooner01/article/details/4289147(VS2005)
http://blog.csdn.net/gy8409/article/details/1148331 (EVC4.0)
按照EVC博客的编译方法,wince4.0、4.2、5.0编译都没有问题,但仍然有些问题
1.环境安装 :跟EVC一样,只是3.0换成了4.0,其中EVC的安装
EVC4.0+evc4sp4.exe+Microsoft Pocket PC 2003 SDK.msi
2.编译:
执行:(在命令行中运行)
set OSVERSION=WCE601
set TARGETCPU=ARMV4I
set PLATFORM=VC-CE
perl config.pl
同样也要设置环境
set PATH=C:/Program Files/Microsoft Visual Studio 8/VC/ce/bin/x86_arm;C:/Program Files/Microsoft Visual Studio 8/VC/bin;C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/bin;C:/Program Files/Microsoft Visual Studio 8/Common7/Tools;C:/Program Files/Microsoft Visual Studio 8/Common7/IDE;C:/Program Files/Microsoft Visual Studio 8/;$(FrameworkSDKDir)Bin;%PATH%
set INCLUDE=C:/Program Files/Windows CE Tools/wce600/EMU_CHS/Include/Armv4i;C:/Program Files/Windows CE Tools/wce600/EMU_CHS/include;C:/Program Files/Microsoft Visual Studio 8/VC/ce/include;C:/Program Files/Microsoft Visual Studio 8/VC/ce/atlmfc/include;C:/Program Files/Microsoft Visual Studio 8/SmartDevices/SDK/PocketPC2003/Include;C:/Program Files/Microsoft Visual Studio 8/SmartDevices/SDK/SQL Server/Mobile/v3.0;C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include;C:/Program Files/Microsoft Visual Studio 8/VC/include;%INCLUDE%
set LIB=C:/Program Files/Windows CE Tools/wce600/EMU_CHS/lib/ARMV4I;C:/Program Files/Microsoft Visual Studio 8/VC/ce/atlmfc/lib/ARMV4I;C:/Program Files/Microsoft Visual Studio 8/VC/ce/lib/ARMV4I; C:/Program Files/Microsoft Visual Studio 8/VC/lib
nmake
生成lib
2.编译OPENSSL
如前面编译4.2一样的。其中.bat文件C:/Program Files/Microsoft eMbedded C++ 4.0/EVC/wce500/bin/WCEARMV4I.BAT
修改改文件(PLATFORM为你自己的wince6.0的SDK)
REM PLATFORM=EMU_CHS
REM OSVERSION=WCE600
REM WCEROOT=C:\Program Files\Microsoft eMbedded C++ 4.0 //Root dir for VCCE
REM SDKROOT=C:\Program Files\Windows CE Tools
set PATH=%WCEROOT%\COMMON\EVC\bin;%WCEROOT%\EVC\WCE500\bin;C:\Program Files\Microsoft Visual Studio 8\VC\ce\bin\x86_arm;C:\Program Files\Microsoft Visual Studio 8\VC\bin;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Bin;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;%path%
set INCLUDE=%SDKROOT%\%OSVERSION%\%PLATFORM%\include\ARMV4I;C:\Program Files\Microsoft Visual Studio 8\VC\ce\include;C:\Program Files\Microsoft Visual Studio 8\VC\ce\atlmfc\include;C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\PocketPC2003\Include;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include;C:\Program Files\Microsoft Visual Studio 8\VC\include;
set LIB=%SDKROOT%\%OSVERSION%\%PLATFORM%\lib\ARMV4I;C:\Program Files\Microsoft Visual Studio 8\VC\ce\atlmfc\lib\armv4i;C:\Program Files\Microsoft Visual Studio 8\VC\ce\lib\armv4i;C:\Program Files\Microsoft Visual Studio 8\VC\lib;
其余同上,编译过程中会出现如下错误:
1, Error message:
PTO -c ./crypto/rsa/rsa_pss.c
cl : Command line warning D9002 : ignoring unknown option '/MC'
rsa_pss.c
f:/openssl/openssl98/crypto/rsa/rsa_pss.c(165) : error C2220: warning treated as
error - no 'object' file generated
f:/openssl/openssl98/crypto/rsa/rsa_pss.c(165) : warning C4748: /GS can not prot
ect parameters and local variables from local buffer overrun because optimizatio
ns are disabled in function
NMAKE : fatal error U1077: '"F:/Program Files/Microsoft Visual Studio 8/VC/ce/bi
n/x86_arm/cl.EXE"' : return code '0x2'
Stop.
Solution: Remove the /WX in cedll.mak
2.找不到winsock.lib时,重新设置lib
set LIB=C:/Program Files/Microsoft Visual Studio 8/VC/ce/lib/ARMV4I;C:/Program Files/Microsoft Visual Studio 8/VC/lib;C:/Program Files/Windows CE Tools/wce600/EMU_CHS/lib/ARMV4I;%LIB%
3. C:/Program Files/Microsoft Visual Studio 8/SmartDevices/SDK/PocketPC2003/Include/winsock2.h中有很多结构重定义了,注释掉这些结构即可。
后记:
若用vs2005 command prompt,编译后有很多错误,老是无法解决!
而且用EVC的编译也有一些麻烦,不知道编译后的结果是否对,EVC中没有wince600这个文件,所以.bat文件我选用的是wince500中的,对其进行了修改
不知道编译后的库是不是有错,无论如何是编译出来了,但是能否用,还不知道怎么看,望做过的人多交流!