• VS2005工程由Pocket PC 2003 SDK转为WINCE6.0 SDK的问题


    把VS2005工程有采用的Pocket PC 2003 SDK改为WINCE6.0 SDK,具体操作见链接

    http://blog.csdn.net/loongembedded/article/details/9306225

    改之后编译出错,错误信息如下:

    1>Compiling...

    1>UhfReader_windows.cpp

    1>F:Program FilesMicrosoft VisualStudio 8VCceincludecrtdefs.h(100) : fatal error C1189: #error :  ERROR: Use of C runtime library internalheader file.

    1>UhfReader_common.cpp

    1>F:Program FilesMicrosoft Visual Studio8VCceincludecrtdefs.h(100) : fatal error C1189: #error :  ERROR: Use of C runtime library internalheader file.

    1>UhfReader_API_Wince.cpp

    1>F:Program FilesMicrosoft VisualStudio 8VCceincludecrtdefs.h(100) : fatal error C1189: #error :  ERROR: Use of C runtime library internalheader file.

    1>stdafx.cpp

    1>F:Program FilesMicrosoft VisualStudio 8VCceincludecrtdefs.h(100) : fatal error C1189: #error :  ERROR: Use of C runtime library internalheader file.

    1>Generating Code...

    “ERROR: Use of C runtime library internal header file.”是说使用了C运行库内部头文件引起了编译的错误,这个问题没有找到解决问题,但相关链接见下面:

    http://bbs.csdn.net/topics/100070913

    http://bbs.csdn.net/topics/350011943

     

    换一种思路去解决编译的问题,打开UhfReader_API_Wince工程文件,把里面的PocketPC 2003 (ARMV4)替换为C5000W (ARMV4I)并保存,但这时候打开工程文件的时候显示的还是Pocket PC 2003 (ARMV4),如图1所示:


    图1

    还需要根据http://blog.csdn.net/loongembedded/article/details/9306225中的描述切换为C5000W(ARMV4I),再编译还是出错,信息如下:

    1>UhfReader_windows.cpp

    1>UhfReader_common.cpp

    1>UhfReader_API_Wince.cpp

    1>Generating Code...

    1>Compiling resources...

    1>Linking...

    1>coredll.lib(COREDLL.dll) : fatalerror LNK1112: module machine type 'THUMB' conflicts with target machine type'ARM'

    1>  Project : warning PRJ0018 : The following environmentvariables were not found:

    出错的信息指模块机器(指令)类型‘THUMB’和目标平台机器(指令)类型‘ARM’冲突,选择project-> properties -> Configuration Properties -> Linker -> Command Line-> Additional options的内容做如下几种处理均可以解决此问题:

    1.  把/subsystem:windowsce,4.20 /machine:ARM/ARMPADCODE替换为/subsystem:windowsce,6.00可以解决此问题。


    图2

    因为我们采用的操作系统是WINCE6.0,这是最好的解决办法。

     

    2.  在/subsystem:windowsce,4.20 /machine:ARM/ARMPADCODE后面增加/subsystem:windowsce,5.01 /machine:THUMB

    /subsystem:windowsce,6.01 /machine:THUMB

    如图3所示:


    图3

    此版本也可以解决此问题,但这两班办法编译的logo信息却不太一样,这两种解决问题的办法在程序运行的过程中,是否有差异,还有待验证:


    图4

    我们先回到前面,为什么会有“module machine type 'THUMB' conflicts with target machinetype 'ARM'”这个编译错误信息,在修改之前,roject ->properties -> Configuration Properties -> Linker -> Command Line ->Additional options的内容是“/subsystem:windowsce,4.20/machine:ARM /ARMPADCODE”,有其中的windowsce,4.20可知此工程是用EVC创建的,因为V2005创建的陈工都是windowsce5.0和6.0的,我们先来看msdn中关于迁移EVC工程到VS2005的相关描述:


    图5

    可见EVC工程中的ARM对应于VS2005的ARMV4,而ARMV4 -> 它只支持 32 ARMV4 指令ARMV4T ->“T”代表 Thumb(16 位指令模式)ARMV4I->“I”代表交互作用(Interworking),它允许 32 位指令和 16 位指令共存 。我们的SDK是基于WINCE6.0+ARMV4I创建的,所以就需要在Additional options替换为或是增加” /subsystem:windowsce,6.00”,而且WinCE系统对指令的支持如下:
    WM4.2/ppc2002/2003
    支持armv4
    WM5.0
    支持armv4i

    WINCE5.06.0支持ARMV4ARMV4I

    详细信息见http://msdn.microsoft.com/en-us/library/ee482410(v=winembedded.60).aspx

    所以就不存在上面编译的错误信息

     

  • 相关阅读:
    中文版CorelDRAW X8实战视频教程
    21天学通Java6(第5版)
    SAS高级统计分析教程(第2版)
    Access2007开发指南(修订版)
    Visual C++开发入行真功夫
    21天学编程系列:21天学通Java(第4版)
    102. Binary Tree Level Order Traversal
    78. Subsets
    79. Word Search
    46. Permutations
  • 原文地址:https://www.cnblogs.com/LoongEmbedded/p/5298611.html
Copyright © 2020-2023  润新知