Compiling Apache APR on Windows

I end up trying to compile something that requires APR from Apache on Windows.

Edit: Trial Visual Studio Command Line Tools for VS2013 and VS2014. SVN show link shows 404: http://apr.apache.org/anonsvn.txt

So...

From this link http://apr.apache.org/compiling_win32.html I have uploaded three files. I unpacked them and renamed them as suggested directory structure.

C: \ Work \ arg \ C: \ work \ April-Iconv \ C: \ work \ April-Util \

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

Note that there is a comment saying "Current versions of APR don't need awk ..." but the link doesn't work, does it matter?

Has anyone had any luck compiling this, 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.

      

+1


source to share


2 answers


From the apache-apr project site under the heading:

Studio Studio / Microsoft IDE Build ::

Open the apr-util / aprutil.dsw workspace and select aprutil or libaprutil (for static or dynamic libraries) with the Release or Debug build as the active project. aprutil.dsw causes all related projects to be created.



You may have ignored this statement: choose aprutil or libaprutil as the active project ...

Then create an active project.

+1


source


A bit late, but here's how I fixed it.

On line 221, change makefile build2 modules.mk.win from

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

      

For



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

      

The target of the shared library 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

0


source







All Articles