在Windows上编译Apache APR [英] Compile Apache APR on Windows

查看:323
本文介绍了在Windows上编译Apache APR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最终结果是我正在尝试编译Windows上需要Apache进行APR的内容.

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

所以...

通过此链接 http://apr.apache.org/compiling_win32.html 我有下载了三个文件.我解压缩了它们,并将其重命名为建议的目录结构.

C:\ work \ apr \ C:\ work \ apr-iconv \ C:\ work \ apr-util \

移动到apr-util目录并运行以下make命令并收到以下错误.

请注意,有评论当前版本的APR不需要awk ...",但是该链接无效,这有关系吗?

任何人都可以编译此文件,我是否需要其他lib/include/objects?

nmake -f Makefile.win buildall checkall installall clean

收到以下错误:

<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.

解决方案

有点晚了,但是这是我解决的方法.

在build \ modules.mk.win生成文件中,将第221行更改为

$(SILENT)link $(ALL_LDFLAGS) $*.obj $(API_LIBS) /out:$@ \

收件人

$(SILENT)link $(ALL_LDFLAGS) $*.obj $(MODRES).obj $(API_LIBS) /out:$@ \

共享库目标现在将显示为:

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

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

The end result is I am trying to compile something that requires the APR from Apache on Windows.

Edit: Tried Visual Studio command line tools for VS2013 & VS2014. Link for SVN checkout shows 404: http://apr.apache.org/anonsvn.txt

so...

From this link http://apr.apache.org/compiling_win32.html I have downloaded the three files. I unzipped them and renames them as the directory structure suggested.

C:\work\apr\ C:\work\apr-iconv\ C:\work\apr-util\

Moved to the apr-util directory and ran the following make command and received the following errors.

Note there is the comment about "Current versions of APR do not need awk..." but the link does not work, does it matter?

Anybody have any luck compiling this, do I need other lib/include/objects?

nmake -f Makefile.win buildall checkall installall clean

Received the following errors:

<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.

解决方案

It's a little late, but here is how I fixed it.

In the build\modules.mk.win makefile change line 221 from

$(SILENT)link $(ALL_LDFLAGS) $*.obj $(API_LIBS) /out:$@ \

To

$(SILENT)link $(ALL_LDFLAGS) $*.obj $(MODRES).obj $(API_LIBS) /out:$@ \

The shared library target will now read:

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

Source: https://gist.github.com/mkhon/01a1536b01e0065ae799

这篇关于在Windows上编译Apache APR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆