0

尝试编译 nginx 时出现以下错误。我找不到任何包含 -luuid 库的 devtoolset-3 rpm。有什么建议么?

/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/ld: cannot find -luuid
collect2: error: ld returned 1 exit status

--

[root@~/nginx-1.13.8] scl enable devtoolset-3 bash
[root@~/nginx-1.13.8] cc -v
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/opt/rh/devtoolset-3/root/usr --mandir=/opt/rh/devtoolset-3/root/usr/share/man --infodir=/opt/rh/devtoolset-3/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/cloog-install --with-mpc=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.9.1 20140922 (Red Hat 4.9.1-10) (GCC)
[root@~/nginx-1.13.8] ./configure --prefix=/usr/local/nginx41 --with-http_v2_module --with-http_ssl_module --with-ipv6 --with-http_stub_status_module --with-http_realip_module --with-http_gzip_static_module --add-module=$HOME/incubator-pagespeed-ngx-1.13.35.2-beta ${PS_NGX_EXTRA_FLAGS}
checking for OS
 + Linux 2.6.32-642.3.1.el6.x86_64 x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.9.1 20140922 (Red Hat 4.9.1-10) (GCC)
checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for gcc builtin 64 bit byteswap ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for EPOLLEXCLUSIVE ... not found
checking for O_PATH ... not found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for prctl(PR_SET_KEEPCAPS) ... found
checking for capabilities ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for sched_setaffinity() ... found
checking for SO_SETFIB ... not found
checking for SO_REUSEPORT ... found
checking for SO_ACCEPTFILTER ... not found
checking for SO_BINDANY ... not found
checking for IP_TRANSPARENT ... found
checking for IP_BINDANY ... not found
checking for IP_BIND_ADDRESS_NO_PORT ... not found
checking for IP_RECVDSTADDR ... not found
checking for IP_SENDSRCADDR ... not found
checking for IP_PKTINFO ... found
checking for IPV6_RECVPKTINFO ... found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE ... found
checking for TCP_FASTOPEN ... not found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for eventfd() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint32_t ... found
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for AF_INET6 ... found
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for pwritev() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for sysconf(_SC_LEVEL1_DCACHE_LINESIZE) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
configuring additional modules
adding module in /root/incubator-pagespeed-ngx-1.13.35.2-beta
mod_pagespeed_dir=/root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include
build_from_source=false
checking for psol ... not found
./configure: error: module ngx_pagespeed requires the pagespeed optimization library.
Look in /root/nginx-1.13.8/objs/autoconf.err for more details.
[root@~/nginx-1.13.8] tail -100 objs/autoconf.err
checking for struct msghdr.msg_control


----------------------------------------
checking for ioctl(FIONBIO)


----------------------------------------
checking for struct tm.tm_gmtoff


----------------------------------------
checking for struct dirent.d_namlen

objs/autotest.c: In function 'main':
objs/autotest.c:8:28: error: 'struct dirent' has no member named 'd_namlen'
     struct dirent  dir; dir.d_namlen = 0;
                            ^
objs/autotest.c:9:41: error: 'struct dirent' has no member named 'd_namlen'
                   printf("%d", (int) dir.d_namlen);
                                         ^
----------

#include <sys/types.h>
#include <unistd.h>
#include <dirent.h>
                  #include <stdio.h>

int main(void) {
    struct dirent  dir; dir.d_namlen = 0;
                  printf("%d", (int) dir.d_namlen);
    return 0;
}

----------
cc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -o objs/autotest objs/autotest.c
----------

----------------------------------------
checking for struct dirent.d_type


----------------------------------------
checking for sysconf(_SC_NPROCESSORS_ONLN)


----------------------------------------
checking for sysconf(_SC_LEVEL1_DCACHE_LINESIZE)


----------------------------------------
checking for openat(), fstatat()


----------------------------------------
checking for getaddrinfo()


----------------------------------------
checking for psol

/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/ld: cannot find -luuid
collect2: error: ld returned 1 exit status
----------

#include <sys/types.h>
#include <unistd.h>

#include "pagespeed/kernel/base/string.h"
#include "pagespeed/kernel/base/string_writer.h"
#include "pagespeed/kernel/base/null_message_handler.h"
#include "pagespeed/kernel/html/html_parse.h"
#include "pagespeed/kernel/html/html_writer_filter.h"


int main() {


  GoogleString output_buffer;
  net_instaweb::StringWriter write_to_string(&output_buffer);

  net_instaweb::NullMessageHandler handler;
  net_instaweb::HtmlParse html_parse(&handler);
  net_instaweb::HtmlWriterFilter html_writer_filter(&html_parse);

  html_writer_filter.set_writer(&write_to_string);
  html_parse.AddFilter(&html_writer_filter);

  html_parse.StartParse("http:example.com");
  html_parse.ParseText(
      "<html ><body ><h1 >Test</h1 ><p>Test Text</p></body></html>\n");
  html_parse.FinishParse();

  printf("parsed as: %s", output_buffer.c_str());
    return 0;
}

----------
cc -D_GLIBCXX_USE_CXX11_ABI=0 --std=c++11 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include/third_party/chromium/src -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include/third_party/google-sparsehash/src/src -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include/third_party/google-sparsehash/gen/arch/linux/x64/include -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include/third_party/grpc/src/include -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include/third_party/protobuf/src/src -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include/third_party/re2/src -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include/out/Release/obj/gen -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include/out/Release/obj/gen/protoc_out/instaweb -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include/third_party/apr/src/include -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include/third_party/aprutil/src/include -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include/third_party/apr/gen/arch/linux/x64/include -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include/third_party/aprutil/gen/arch/linux/x64/include -I /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/include/url -o objs/autotest objs/autotest.cc /root/incubator-pagespeed-ngx-1.13.35.2-beta/psol/lib/Release/linux/x64/pagespeed_automatic.a -lstdc++ -lrt -pthread -lm -luuid
----------
[root@~/nginx-1.13.8]
4

1 回答 1

0

需要安装缺少的软件包。

wget https://rpmfind.net/linux/centos/6.9/os/x86_64/Packages/libuuid-devel-2.17.2-12.28.el6.x86_64.rpm

rpm -ivh libuuid-devel-2.17.2-12.28.el6.x86_64.rpm
于 2018-02-01T23:11:35.740 回答