2017-04-01 5 views
0

here 이상 제공하는 make_torrent 예제 코드를 실행하려고합니다. 난dyld : 기호를 찾을 수 없습니다 : _ERR_remove_thread_state

컴파일 내가 준수하고 make_torrent.cc 파일을 연결 한 방법 설치 libtorrent 여기

here에 걸쳐 기록 된 내용을 기반으로했다.

g++ -g -Wall make_torrent.cc -ltorrent-rasterbar -lboost_system -o make_torrent 

는 make_torrent 샘플 코드를 실행하면 나는이

usage: make_torrent FILE [OPTIONS] 

Generates a torrent file from the specified file 
or directory and writes it to standard out 

OPTIONS: 
-m file  generate a merkle hash tree torrent. 
       merkle torrents require client support 
       the resulting full merkle tree is written to 
       the specified file 
-w url  adds a web seed to the torrent with 
       the specified url 
-t url  adds the specified tracker to the 
       torrent. For multiple trackers, specify more 
       -t options 
-c comment sets the comment to the specified string 
-C creator sets the created-by field to the specified string 
-p bytes  enables padding files. Files larger 
       than bytes will be piece-aligned 
-s bytes  specifies a piece size for the torrent 
       This has to be a multiple of 16 kiB 
-l   Don't follow symlinks, instead encode them as 
       links in the torrent file 
-o file  specifies the output filename of the torrent file 
       If this is not specified, the torrent file is 
       printed to the standard out, except on windows 
       where the filename defaults to a.torrent 
-r file  add root certificate to the torrent, to verify 
       the HTTPS tracker 
-S info-hash add a similar torrent by info-hash. The similar 
       torrent is expected to share some files with this one 
-L collection add a collection name to this torrent. Other torrents 
       in the same collection is expected to share files 
       with this one. 
-M   make the torrent compatible with mutable torrents 
       this means aligning large files and pad them in order 
       for piece hashes to uniquely indentify a file without 
       overlap 
dyld: lazy symbol binding failed: Symbol not found: _ERR_remove_thread_state 
    Referenced from: /usr/local/lib/libtorrent-rasterbar.9.dylib 
    Expected in: flat namespace 

dyld: Symbol not found: _ERR_remove_thread_state 
    Referenced from: /usr/local/lib/libtorrent-rasterbar.9.dylib 
    Expected in: flat namespace 

은 내가 토런트를 만들기 위해 관련 인수를 제공해야 알아 볼 수 있지만 libtorrent 링커에 대해 불평하는 이유를 잘 모르겠어요

g++ --version 
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Apple LLVM version 8.0.0 (clang-800.0.42.1) 
Target: x86_64-apple-darwin16.4.0 
Thread model: posix 
InstalledDir: /Library/Developer/CommandLineTools/usr/bin 

단서가 있습니까?

답변

0

이것은 openssl에 올바르게 연결하지 않아서 발생합니다. OSX에서 기본 설치 경로에 이전 버전의 openssl이 있다고 가정합니다.

brew install openssl으로 openssl을 설치하는 것이 좋습니다. 이 경우 홈브류가 설치되어 있어야합니다. 이렇게 한 다음에는 openssl 정보를 작성하고 LDFLAGSCPPFLAGS에 무엇을 추가 할 것인지 알려주는 라인을 찾으십시오. 문제가 해결되지 않으면 나는 또한 libtorrent를 컴파일 할 때 이러한 플래그를 포함해야 할 것,

g++ -g -Wall -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include make_torrent.cc -ltorrent-rasterbar -lboost_system -o make_torrent 

: 내 경우 :

For compilers to find this software you may need to set: 
    LDFLAGS: -L/usr/local/opt/openssl/lib 
    CPPFLAGS: -I/usr/local/opt/openssl/include 
For pkg-config to find this software you may need to set: 
    PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig 

그래서 내 경우에, 나는 그와 함께 컴파일합니다.