Error when compiling apache, “Undefined symbols:Undefined symbols:”_apr_dir_read$INODE64“…ld: symbol(s) not found”

不想你离开。 提交于 2019-12-13 00:23:30

问题


I am trying to compile Apache. I did download the latest version of the sourcecode (2.2.17). This is what I do:

> sudo ./configure --prefix=/usr/local/apache2 --with-included-apr --enable-mods-shared=all --enable-module=so

> sudo make

and when doing that I get:

/Users/Niklas/Development/apache/httpd-2.2.17/srclib/apr/libtool --silent --mode=link gcc -g -O2        -o httpd  modules.lo buildmark.o -export-dynamic server/libmain.la modules/http/libmod_http.la modules/mappers/libmod_so.la server/mpm/prefork/libprefork.la os/unix/libos.la  /Users/Niklas/Development/apache/httpd-2.2.17/srclib/pcre/libpcre.la /Users/Niklas/Development/apache/httpd-2.2.17/srclib/apr-util/libaprutil-1.la -lexpat -liconv /Users/Niklas/Development/apache/httpd-2.2.17/srclib/apr/libapr-1.la -lpthread
Undefined symbols:
  "_apr_dir_read$INODE64", referenced from:
      _process_resource_config_nofnmatch in libmain.a(config.o)
      _ap_process_resource_config in libmain.a(config.o)
  "_apr_file_info_get$INODE64", referenced from:
      _ap_pcfg_openfile in libmain.a(util.o)
  "_apr_dir_open$INODE64", referenced from:
      _process_resource_config_nofnmatch in libmain.a(config.o)
      _ap_process_resource_config in libmain.a(config.o)
  "_apr_stat$INODE64", referenced from:
      _ap_process_resource_config in libmain.a(config.o)
      _ap_mpm_set_coredumpdir in libmain.a(mpm_common.o)
      _ap_is_directory in libmain.a(util.o)
      _ap_is_rdirectory in libmain.a(util.o)
      _ap_log_pid in libmain.a(log.o)
      _unixd_pre_config in libos.a(unixd.o)
      _resolve_symlink in libmain.a(request.o)
      _resolve_symlink in libmain.a(request.o)
      _resolve_symlink in libmain.a(request.o)
      _ap_directory_walk in libmain.a(request.o)
      _ap_directory_walk in libmain.a(request.o)
      _ap_directory_walk in libmain.a(request.o)
      _ap_sub_req_lookup_dirent in libmain.a(request.o)
      _ap_sub_req_lookup_dirent in libmain.a(request.o)
      _ap_sub_req_lookup_file in libmain.a(request.o)
      _ap_sub_req_lookup_file in libmain.a(request.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [httpd] Error 1
make: *** [all-recursive] Error 1

What am I doing wrong?

I am using OSX but I guess that shouldn't matter?

I have been struggling with this for several days so I hope someone can point me in the rigth direction?

Thank you in advnace!

Regards, Niklas


回答1:


You're trying to build on OSX? Do you have the dev tools installed?

Your compile definitely failed which is why it's not working. You would probably be better off looking for precompiled packages to do what you need to do. At the very least you would be better off looking for guides to building apache on OSX.

Apache also has a way to compile install just the modules you're trying to add on using a utility called apxs2. OSX should have Apache installed already and I can't imagine they wouldn't have enabled that in their build.

Granted I don't know for sure but a good place to start would be to Google install mod_dbd on OSX

Hope that helps!




回答2:


I had a similar problem while building httpd 2.4.2 on Mac OS X, first download the latest APR from here http://apr.apache.org/ then compile and install it somewhere, then reconfigure httpd like this

./configure --with-apr=/Users/youruser/where/you/installed/apr


来源:https://stackoverflow.com/questions/4082067/error-when-compiling-apache-undefined-symbolsundefined-symbols-apr-dir-read

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!