2014-04-28 145 views
2

我對OpenSSL很新穎。我的目標是編譯OpenSSL for WINCE 6.0 OS。在Google上花費大量時間後,我找到了一個爲WINCE 6.0構建OpenSSL的過程。但是我嘗試構建wcecompat庫是不成功的。下面是我的環境WINCE 6.0 Openssl編譯錯誤

  • 主機平臺:WINDOWS 7
  • 的Visual Studio:2008
  • TargetCpu:86

下面是步驟跟着建立wcecompat:

  1. 下載源自「https://github.com/mauricek/wcecompat/tree/master」git。
  2. 使用Visual Studio命令提示符進行構建。聲明以下變量的ENV:

    set OSVERSION=WCE600
    set TARGETCPU=x86
    set PLATFORM=VC-CE

  3. 使用 「perl的config.pl」 命令創建的make文件。

  4. 執行nmake命令。

構建失敗並顯示編譯錯誤。以下是日誌:

-------------------------------------------------------------------------------------------------- 
args.cpp 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(235) : error C2059: syntax error : '(' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(237) : error C2059: syntax error : '(' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(239) : error C2059: syntax error : '(' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(241) : error C2059: syntax error : '(' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(243) : error C2059: syntax error : '(' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(245) : error C2059: syntax error : '(' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(247) : error C2059: syntax error : '(' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(249) : error C2059: syntax error : '(' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(251) : error C2059: syntax error : '(' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(253) : error C2059: syntax error : '(' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(255) : error C2059: syntax error : '(' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(257) : error C2059: syntax error : '(' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(258) : error C2059: syntax error : '(' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(994) : error C2556: 'const wchar_t *wcschr(const wchar_t *,wchar_t)' : overloaded function differs only by return type from 'wchar_t *wcschr(const wchar_t *,wchar_t)' 
     include\string.h(36) : see declaration of 'wcschr' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(994) : error C2373: 'wcschr' : redefinition; different type modifiers 
     include\string.h(36) : see declaration of 'wcschr' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(1026) : error C2556: 'const wchar_t *wcspbrk(const wchar_t *,const wchar_t *)' : overloaded function differs only by return type from 'wchar_t *wcspbrk(const wchar_t *,const wchar_t *)' 
     include\string.h(46) : see declaration of 'wcspbrk' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(1026) : error C2373: 'wcspbrk' : redefinition; different type modifiers 
     include\string.h(46) : see declaration of 'wcspbrk' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(1027) : error C2556: 'const wchar_t *wcsrchr(const wchar_t *,wchar_t)' : overloaded function differs only by return type from 'wchar_t *wcsrchr(const wchar_t *,wchar_t)' 
     include\string.h(47) : see declaration of 'wcsrchr' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(1027) : error C2373: 'wcsrchr' : redefinition; different type modifiers 
     include\string.h(47) : see declaration of 'wcsrchr' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(1029) : error C2556: 'const wchar_t *wcsstr(const wchar_t *,const wchar_t *)' : overloaded function differs only by return type from 'wchar_t *wcsstr(const wchar_t *,const wchar_t *)' 
     include\string.h(49) : see declaration of 'wcsstr' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(1029) : error C2373: 'wcsstr' : redefinition; different type modifiers 
     include\string.h(49) : see declaration of 'wcsstr' 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(1079) : error C2264: 'wcschr' : error in function definition or declaration; function not called 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(1081) : error C2264: 'wcspbrk' : error in function definition or declaration; function not called 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(1083) : error C2264: 'wcsrchr' : error in function definition or declaration; function not called 
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(1085) : error C2264: 'wcsstr' : error in function definition or declaration; function not called 
include\stdio.h(62) : warning C4005: 'stdin' : macro redefinition 
     C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(81) : see previous definition of 'stdin' 
include\stdio.h(63) : warning C4005: 'stdout' : macro redefinition 
     C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(82) : see previous definition of 'stdout' 
include\stdio.h(64) : warning C4005: 'stderr' : macro redefinition 
     C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(83) : see previous definition of 'stderr' 
include\stdio.h(74) : error C2375: 'swprintf' : redefinition; different linkage 
     C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\swprintf.inl(85) : see declaration of 'swprintf' 
include\stdio.h(75) : error C2375: 'vswprintf' : redefinition; different linkage 
     C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\swprintf.inl(97) : see declaration of 'vswprintf' 
include\stdio.h(125) : error C2733: second C linkage of overloaded function '_wfdopen' not allowed 
     include\stdio.h(125) : see declaration of '_wfdopen' 
include\stdlib.h(48) : warning C4273: '_wputenv' : inconsistent dll linkage 
     C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(955) : see previous definition of '_wputenv' 
include\stdlib.h(90) : warning C4273: '_ultow' : inconsistent dll linkage 
     C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(884) : see previous definition of '_ultow' 
include\stdlib.h(91) : warning C4273: '_itow' : inconsistent dll linkage 
     C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(878) : see previous definition of '_itow' 
include\stdlib.h(92) : warning C4273: '_ltow' : inconsistent dll linkage 
     C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(881) : see previous definition of '_ltow' 
include\stdlib.h(95) : warning C4273: 'wcstoul' : inconsistent dll linkage 
     C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(889) : see previous definition of 'wcstoul' 
c:\workspace\wcecompat-master\src\ts_string.h(106) : warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 
     include\string.h(38) : see declaration of 'wcscpy' 
c:\workspace\wcecompat-master\src\ts_string.h(151) : warning C4996: 'wcscat': This function or variable may be unsafe. Consider using wcscat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 
     include\string.h(35) : see declaration of 'wcscat' 
------------------------------------------------------------------------------------------------ 

我是否缺少任何配置步驟?我現在被困了2周。請幫我解決這個錯誤。

+0

你可以發佈「perl config.pl」的輸出嗎?另外,您是否爲您的目標設備安裝了SDK? –

+0

感謝您的回覆。是的,我有VS 2005和WINCE 6.0編譯環境設置的XP機器。目標設備是CEPC。仍然我得到同樣的錯誤,我得到了VS 2008.Below是「perl config.pl」在VS 2005 cmd提示符下執行時的輸出: ----------------- ------------- Windows CE版本:WCE600 大:6 未成年人:00 編譯的架構:X86 編譯:-D_WIN32_WCE = 0x600 -DUNDER_CE = 600 -Dx86 -D_X86_ 鏈接:/ SUBSYSTEM:windowsce,6.00 /NODEFAULTLIB:oldnames.lib coredll.lib corelibc.lib/MACHINE:X86。 ------------------------------------------------- - 讓我知道更多的細節。 – user3224937

+0

從wcecompat構建說明,我沒有發現任何依賴於WINCE 6.0 SDK或平臺bulder。在那裏,他聲明瞭OSVERSION,PLATFORM和TARGETCPU環境變量,並使用perl和nmake命令。我是否需要聲明PATH,INCLUDE和LIB變量? – user3224937

回答

0
Using Visual Studio Command prompt for build... 

C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\wchar.h(235) : error C2059: syntax error : '(' 
... 

看起來你正在使用標準的Visual Studio命令提示符,而不是交叉編譯命令提示符。

您是否安裝了Windows Embedded CE 6.0 Platform Builder或Mobile SDKs?據我瞭解,Windows CE在醫療設備製造商中仍然很受歡迎(FDA監督醫療設備,他們不喜歡改變(很像NIST和OpenSSL FIPS驗證))。

Platform Builder已獲得許可,但Windows Mobile SDK是免費的。我沒有Platform Builder的鏈接,因爲我用MSDN光盤安裝它。這裏是鏈接到Windows Mobile軟件開發工具包:

(我有聯繫那兒剽竊走,他們現在可能是壞天,文本文件的日期是2009/2010)。

SDK應該爲您提供交叉編譯命令提示符。不幸的是,我不記得確切的步驟。我在6年或7年沒有與Windows CE合作過。

+0

感謝您的回覆。是的,我安裝了WINCE 6.0平臺構建器並使用VS命令提示符進行構建。我的目標平臺是CEPC。據我所知,不需要交叉編譯器命令提示符。糾正我,如果我錯了。 – user3224937