在Windows上编译Apache APR

时间:2016-04-27 18:10:14

标签: windows apache awk apr

最终结果是我试图在Windows上编译需要Apache的APR的东西。

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

所以...

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

C:\工作\的apr \ C:\工作\ APR-的iconv \ C:\工作\ APR-util的\

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

注意有关于&#34的评论;当前版本的APR不需要awk ..."但链接不起作用,这有关系吗?

任何人都有运气编译,我还需要其他lib / include /对象吗?

nmake -f Makefile.win buildall checkall installall clean

收到以下错误:

void execute(COMMAND *commlist) {
  int fd[2];
  pid_t pid;
  int n_pipes=2; //pipes needed
  COMMAND *aux = commlist;

  int i;
  for(i=0;i<n_pipes; i++){
    int oldfd = 0;

    if(fd[0]!=0){
      close(fd[1]);
      oldfd = fd[0];
    }
      pipe(fd);

      if((pid=fork())<0){perror("Fork Failed");}
      else 
        if(pid == 0){

          if(inputfile!=NULL){
            int in = open(inputfile,O_RDONLY);
            dup2(in,STDIN_FILENO);
            inputfile = NULL;
          }

          if(outputfile != NULL){
            int out = open(outputfile, O_RDWR |O_CREAT | O_TRUNC, S_IRWXU);
            dup2(out,STDOUT_FILENO);
            outputfile = NULL;
          }

          if(oldfd)
            dup2(oldfd,STDIN_FILENO);

          if(commlist->cmd == "grepwc"){
            if(i==0){
              if(execlp("grep","grep","celio",NULL)<0){
                perror("Bad command");
                exit(1);    
              }
            }

            if(i==1){
              if(execlp("wc","wc","-l",NULL) < 0){
                perror("Bad command");
                exit(1);
              }
            }
          }
        }//child
  }
}

2 个答案:

答案 0 :(得分:2)

有点晚了,但这就是我修复它的方法。

在build \ modules.mk.win makefile中更改第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

答案 1 :(得分:1)

从标题为

下的apache-apr项目网站
  

Developer Studio工作区/ Microsoft开发环境IDE Build ::

     

打开apr-util / aprutil.dsw工作区,并选择aprutil或libaprutil(对于静态或动态库),其中Release或Debug版本作为Active Project。 aprutil.dsw导致所有相关项目的构建。

也许你忽略了这句话:选择aprutil或libaprutil作为Active Project ......

然后构建活动项目。