小吴的世界 2016-11-07 06:48 采纳率: 100%
浏览 1247
已采纳

怎么编译在https://github.com/rakshasa/libtorrent下的库

看了下很多教程编译libtorrent,发现还是不能用在这个项目中对库的编译?求高手帮助,谢谢!

  • 写回答

2条回答 默认 最新

  • vcommon 2016-11-07 09:35
    关注
     peterdeMBP:libtorrent peter$ ./autogen.sh
    aclocal...
    autoheader...
    glibtoolize: putting macros in 'scripts'.
    glibtoolize: copying file 'scripts/libtool.m4'
    glibtoolize: copying file 'scripts/ltoptions.m4'
    glibtoolize: copying file 'scripts/ltsugar.m4'
    glibtoolize: copying file 'scripts/ltversion.m4'
    glibtoolize: copying file 'scripts/lt~obsolete.m4'
    glibtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([scripts])' to configure.ac,
    glibtoolize: and rerunning glibtoolize and aclocal.
    -n libtoolize... 
    using glibtoolize
    automake...
    configure.ac:3: installing './compile'
    configure.ac:3: installing './config.guess'
    configure.ac:3: installing './config.sub'
    configure.ac:20: installing './install-sh'
    configure.ac:20: installing './missing'
    src/Makefile.am: installing './depcomp'
    parallel-tests: installing './test-driver'
    autoconf...
    ready to configure
    
    
     peterdeMBP:libtorrent peter$ ./configure
    checking build system type... x86_64-apple-darwin15.6.0
    checking host system type... x86_64-apple-darwin15.6.0
    checking how to print strings... printf
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking whether gcc understands -c and -o together... yes
    checking for a sed that does not truncate output... /usr/bin/sed
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for fgrep... /usr/bin/grep -F
    checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
    checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface... BSD nm
    checking whether ln -s works... yes
    checking the maximum length of command line arguments... 196608
    checking how to convert x86_64-apple-darwin15.6.0 file names to x86_64-apple-darwin15.6.0 format... func_convert_file_noop
    checking how to convert x86_64-apple-darwin15.6.0 file names to toolchain format... func_convert_file_noop
    checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
    checking for objdump... no
    checking how to recognize dependent libraries... pass_all
    checking for dlltool... no
    checking how to associate runtime and link libraries... printf %s\n
    checking for ar... ar
    checking for archiver @FILE support... no
    checking for strip... strip
    checking for ranlib... ranlib
    checking for gawk... no
    checking for mawk... no
    checking for nawk... no
    checking for awk... awk
    checking command to parse /usr/bin/nm -B output from gcc object... ok
    checking for sysroot... no
    checking for a working dd... /bin/dd
    checking how to truncate binary pipes... /bin/dd bs=4096 count=1
    checking for mt... no
    checking if : is a manifest tool... no
    checking for dsymutil... dsymutil
    checking for nmedit... nmedit
    checking for lipo... lipo
    checking for otool... otool
    checking for otool64... no
    checking for -single_module linker flag... yes
    checking for -exported_symbols_list linker flag... yes
    checking for -force_load linker flag... yes
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if gcc supports -fno-rtti -fno-exceptions... yes
    checking for gcc option to produce PIC... -fno-common -DPIC
    checking if gcc PIC flag -fno-common -DPIC works... yes
    checking if gcc static flag -static works... no
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
    checking dynamic linker characteristics... darwin15.6.0 dyld
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... no
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... ./install-sh -c -d
    checking whether make sets $(MAKE)... yes
    checking for style of include used by make... GNU
    checking whether make supports nested variables... yes
    checking dependency style of gcc... gcc3
    checking for g++... g++
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking how to run the C++ preprocessor... g++ -E
    checking for ld used by g++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
    checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
    checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
    checking for g++ option to produce PIC... -fno-common -DPIC
    checking if g++ PIC flag -fno-common -DPIC works... yes
    checking if g++ static flag -static works... no
    checking if g++ supports -c -o file.o... yes
    checking if g++ supports -c -o file.o... (cached) yes
    checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
    checking dynamic linker characteristics... darwin15.6.0 dyld
    checking how to hardcode library paths into programs... immediate
    checking dependency style of g++... gcc3
    checking whether byte ordering is bigendian... no
    checking whether g++ supports C++11 features by default... no
    checking whether g++ supports C++11 features with -std=c++11... yes
    checking should use TR1 headers... no
    checking for special C compiler options needed for large files... no
    checking for _FILE_OFFSET_BITS value needed for large files... no
    checking the byte alignment... none needed
    checking for sysroot... no
    checking for kqueue support... yes
    checking whether kqueue supports pipes and ptys... no
    checking for epoll support... no
    checking for fallocate... no
    checking size of long... 8
    checking sys/vfs.h usability... no
    checking sys/vfs.h presence... no
    checking for sys/vfs.h... no
    checking sys/statvfs.h usability... yes
    checking sys/statvfs.h presence... yes
    checking for sys/statvfs.h... yes
    checking sys/statfs.h usability... no
    checking sys/statfs.h presence... no
    checking for sys/statfs.h... no
    checking for statvfs... ok
    checking sys/inotify.h usability... no
    checking sys/inotify.h presence... no
    checking for sys/inotify.h... no
    checking mcheck.h usability... no
    checking mcheck.h presence... no
    checking for mcheck.h... no
    checking whether sys/inotify.h actually works... failed
    checking if compiler supports __attribute__((visibility("default")))... yes
    checking whether pthreads work without any flags... yes
    checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
    checking if more special flags are required for pthreads... -D_THREAD_SAFE
    checking for PTHREAD_PRIO_INHERIT... yes
    checking if zlib is wanted... yes
    checking for inflateEnd in -lz... yes
    checking zlib.h usability... yes
    checking zlib.h presence... yes
    checking for zlib.h... yes
    checking for pkg-config... /usr/local/bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    checking for CPPUNIT... no
    checking for OPENSSL... yes
    checking for posix_memalign... yes
    checking for madvise... yes
    checking for cacheline... using default 128 bytes
    checking for __builtin_popcount... yes
    checking for execinfo.h... yes
    checking pthread.h usability... yes
    checking pthread.h presence... yes
    checking for pthread.h... yes
    checking for pthread_setname_np type... darwin
    checking signedness of mincore parameter... signed
    checking if instrumentation should be included... yes
    checking if compiler supports __attribute__((unused))... yes
    checking that generated files are newer than configure... done
    configure: creating ./config.status
    config.status: creating libtorrent.pc
    config.status: creating Makefile
    config.status: creating src/Makefile
    config.status: creating src/torrent/Makefile
    config.status: creating src/torrent/data/Makefile
    config.status: creating src/torrent/download/Makefile
    config.status: creating src/torrent/net/Makefile
    config.status: creating src/torrent/peer/Makefile
    config.status: creating src/torrent/utils/Makefile
    config.status: creating src/data/Makefile
    config.status: creating src/dht/Makefile
    config.status: creating src/download/Makefile
    config.status: creating src/net/Makefile
    config.status: creating src/protocol/Makefile
    config.status: creating src/tracker/Makefile
    config.status: creating src/utils/Makefile
    config.status: creating test/Makefile
    config.status: creating config.h
    config.status: executing libtool commands
    config.status: executing depfiles commands
    
     peterdeMBP:libtorrent peter$ make
    /Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
    Making all in src
    Making all in torrent
    Making all in data
    /bin/sh ../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../..  -I. -I./.. -I./../.. -I../../.. -I/usr/include -I/usr/include  -D_THREAD_SAFE   -g -O2 -g -DDEBUG -Wall -std=c++11 -fvisibility=hidden  -MT block.lo -MD -MP -MF .deps/block.Tpo -c -o block.lo block.cc
    
    ......
    libtool: link: g++ -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libtorrent.19.dylib  .libs/globals.o .libs/manager.o .libs/thread_disk.o .libs/thread_main.o   -Wl,-force_load,torrent/.libs/libsub_torrent.a -Wl,-force_load,torrent/data/.libs/libsub_torrentdata.a -Wl,-force_load,torrent/download/.libs/libsub_torrentdownload.a -Wl,-force_load,torrent/net/.libs/libsub_torrentnet.a -Wl,-force_load,torrent/peer/.libs/libsub_torrentpeer.a -Wl,-force_load,torrent/utils/.libs/libsub_torrentutils.a -Wl,-force_load,data/.libs/libsub_data.a -Wl,-force_load,dht/.libs/libsub_dht.a -Wl,-force_load,download/.libs/libsub_download.a -Wl,-force_load,net/.libs/libsub_net.a -Wl,-force_load,protocol/.libs/libsub_protocol.a -Wl,-force_load,tracker/.libs/libsub_tracker.a -Wl,-force_load,utils/.libs/libsub_utils.a  -L/usr/lib -lcrypto -lz  -g -O2 -g   -install_name  /usr/local/lib/libtorrent.19.dylib -compatibility_version 20 -current_version 20.0 -Wl,-single_module
    libtool: link: (cd ".libs" && rm -f "libtorrent.dylib" && ln -s "libtorrent.19.dylib" "libtorrent.dylib")
    libtool: link: ( cd ".libs" && rm -f "libtorrent.la" && ln -s "../libtorrent.la" "libtorrent.la" )
    Making all in test
    make[2]: Nothing to be done for `all'.
    
    
    
    
    peterdeMBP:libtorrent peter$ cd src
    peterdeMBP:src peter$ ls
    Makefile    download    manager.cc  thread_disk.cc  thread_main.lo
    Makefile.am globals.cc  manager.h   thread_disk.h   torrent
    Makefile.in globals.h   manager.lo  thread_disk.lo  tracker
    data        globals.lo  net     thread_main.cc  utils
    dht     libtorrent.la   protocol    thread_main.h
    
    

    from www.diyerland.com

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog