2016-04-27 73 views
1

最终结果是我想编译一些需要Windows上Apache的APR。在Windows上编译Apache APR

编辑:尝试Visual Studio命令行工具VS2013 & VS2014。 链接SVN结帐显示404:http://apr.apache.org/anonsvn.txt

所以......

从这个链接http://apr.apache.org/compiling_win32.html我已经下载了三个文件。我解压缩它们并将它们重命名为目录结构。

C:\工作\月\ C:\工作\ APR-的iconv \ C:\工作\ APR-UTIL \

移动到APR-util目录和运行以下make命令和接收以下错误。

请注意有关“当前版本的APR不需要awk ...”的注释,但链接不起作用,这有什么关系吗?

任何人都有幸编译这个,我需要其他的lib/include/objects吗?

NMAKE -f Makefile.win buildall checkall installall干净

收到以下错误:

<clip> 
rc.exe /l 0x409 /fo".\Release\libapriconv.res" /i "./include" /i "../apr/include" /d "NDEBUG" /d "API_VERSION_ONLY" .\libapriconv.rc 
Microsoft (R) Windows (R) Resource Compiler Version 6.3.9600.17336 
Copyright (C) Microsoft Corporation. All rights reserved. 

link.exe @C:\Users\JOHNAT~1\AppData\Local\Temp\nm390A.tmp 
Creating library .\Release\libapriconv-1.lib and object .\Release\libapriconv-1.exp 
    if exist .\Release\libapriconv-1.dll.manifest mt.exe -manifest .\Release\libapriconv-1.dll.manifest -outputresource:.\Release\libapriconv-1.dll;2 
    echo Helper for Post-build step > ".\Release\postbld.dep" 
    cd ccs 
    "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe" -nologo -f Makefile.win all BUILD_MODE="Win32 Release" BIND_MODE=shared adobe-stdenc.c 
Creating library ..\Release\iconv\adobe-stdenc.lib and object ..\Release\iconv\adobe-stdenc.exp 
adobe-stdenc.obj : error LNK2011: precompiled object not linked in; image may not run 
..\Release\iconv\adobe-stdenc.so : fatal error LNK1120: 1 unresolved externals 
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\link.EXE"' : return code '0x460' 
Stop. 
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2' 
Stop. 

回答

1

从Apache-APR项目网站标题下:

开发工作室工作区/ Microsoft开发环境IDE构建::

打开apr-util/aprutil.dsw工作空间,并将Release或Debug版本选作aprotil或libaprutil(对于静态或动态库)作为活动项目。 aprutil.dsw会导致所有相关项目的建立。

也许你忽略了这个说法:选择使用aprutil或libaprutil为活动项目 ...

然后建立活动项目。

0

这有点晚,但这里是我如何修复它。

在构建\ modules.mk.win生成文件变更线221从

$(SILENT)link $(ALL_LDFLAGS) $*.obj $(API_LIBS) /out:[email protected] \ 

$(SILENT)link $(ALL_LDFLAGS) $*.obj $(MODRES).obj $(API_LIBS) /out:[email protected] \ 

共享库目标现在将读取:

.c{$(OUTPUT_DIR)}.so: 
$(SILENT)cl $(ALL_CFLAGS) /Fo$*.obj /Yuiconv.h /c $< 
$(SILENT)link $(ALL_LDFLAGS) $*.obj $(MODRES).obj $(API_LIBS) /out:[email protected] \ 
    /base:@"..\build\BaseAddr.ref",$(@F) 
$(SILENT)if exist [email protected] \ 
    $(SILENT)mt -nologo -manifest [email protected] -outputresource:[email protected];2 \ 
    & del "[email protected]" 
$(SILENT)del "$*.exp" & del "$*.lib" 

来源: https://gist.github.com/mkhon/01a1536b01e0065ae799