Comments (21)
Considering I've recently upgraded this should get fixed soon.
ATM use the macports clang to compile.
from libtorrent.
BTW, I'm pretty sure the union above was added since it is supposed to be supported by C++11.
Need to look into the copy constructor part.
from libtorrent.
ATM use the macports clang to compile.
The system clang also works in libstdc++ mode, this is specifically a libc++ issue. If Macports's clang works, I imagine it's because it's defaulting to libstdc++.
from libtorrent.
So if I upgraded to Mavericks and installed rtorrent via MacPorts, would libtorrent "build" (I'm a layman to the world of developers)?
from libtorrent.
so just to check - there is still no way to build rtorrent on mavericks even though this commit says:
libtorrent: use libstdc++ if compiling with clang on mavericks, fixes
right? I can't get it to compile even after trying with that added line...
from libtorrent.
@clarkewd Can you discuss Homebrew issues on the Homebrew tracker? The issue is Homebrew/legacy-homebrew#23483
from libtorrent.
CC=clang CXX=clang++ CXXFLAGS="-Wno-deprecated-declarations -O3 -std=c++11 -stdlib=libc++" ./configure
With these settings I could compile with C++11 check succeeding.
from libtorrent.
There are several issues there with clang 3.3. Here's what I use on ArchBSD to build it:
https://github.com/ArchBSD/abs/blob/master/community/libtorrent/PKGBUILD#L38
Starting from line 38:
The first two are missing headers - FreeBSD systems seem to have much stricter headers around.
The parts below are to make it actually compile as C++11 code.
libc++'s tr1 headers don't actually make a tr1 namespace.
Also, tr1 is not an actual standard, you shouldn't use it in an actual project.
(Note that I explicitly set -std=c++11
in the CXXFLAGS since the configure checks for it fail.)
And the patch used is to avoid link errors when building rtorrent:
https://github.com/ArchBSD/abs/blob/master/community/libtorrent/missing_references.diff
Declaring static const
variables only in the class-def is simply not enough. I don't know why exactly clang wants to take a reference to them in the rtorrent code - it shouldn't - but in any case, providing the actual symbols is more correct.
from libtorrent.
I'm still unable to libtorrent using clang (not via homebrew). I set the CXXFLAGS to
CXXFLAGS="-Wno-deprecated-declarations -O3 -std=c++11 -stdlib=libc++"
as suggested above and received this error:
Making all in data
/bin/sh ../../../libtool --tag=CXX --mode=compile clang++ -DHAVE_CONFIG_H -I. -I../../.. -I. -I./.. -I./../.. -I../../.. -Wno-deprecated-declarations -O3 -std=c++11 -stdlib=libc++ -g -DDEBUG -fvisibility=hidden -D_THREAD_SAFE -MT block.lo -MD -MP -MF .deps/block.Tpo -c -o block.lo block.cc
libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I../../.. -I. -I./.. -I./../.. -I../../.. -Wno-deprecated-declarations -O3 -std=c++11 -stdlib=libc++ -g -DDEBUG -fvisibility=hidden -D_THREAD_SAFE -MT block.lo -MD -MP -MF .deps/block.Tpo -c block.cc -fno-common -DPIC -o .libs/block.o
In file included from block.cc:44:
In file included from ./../../protocol/peer_connection_base.h:42:
./../../torrent/poll.h:40:10: fatal error: 'tr1/functional' file not found
#include <tr1/functional>
Which points to the real issue that @Blub mentions above that libc++ doesn't include the namespace tr1 since the majority of its features are included in c++11. So would the best option moving forward be adding preprocessor checks for libc++ to remove referencing the tr1 namespace as suggested here: http://stackoverflow.com/questions/13219007/xcode-4-5-tr1-type-traits-file-not-found?
from libtorrent.
Your compile error is about the missing tr1/functional
file in the include path, not the namespace for inside the code. If you have c++11 headers around you can try using those (just remove the tr1/
from the path) instead and then you'll get the namespace related errors. I wonder if the other issues still exist with clang 3.4+ as they seem weird to even be there to begin with. (I'll see once FreeBSD merges the next update into the stable/10 branch)
from libtorrent.
There is clang++ for compiling C++ tuff. Try that.
from libtorrent.
/me points to the clang++
part of the commands pasted above...
from libtorrent.
@Blub Yea, I realize its that stdc++ doesn't have the "tr1" headers inside of a "tr1" directory. This is the correct behavior for c++11, right? So I've tried removing all references to tr1 in the code and recompiling via clang++ and manually setting -std=c++11
in the CXXFLAGS since the configure script fails for that check as @rakshasa mentions above. I'm still debugging compile errors for std::bind (instead of std::tr1::bind). However, once this is working, this should be how the code should be structured — without explicit references to tr1 — right?
from libtorrent.
It should. As you can see in the PKGBUILD link I posted above, there are a few more replacements happening. (like .assign
-> .fill
- basically everything after the port-patches are applied is to compile as c++11 as we prefer clang/libc++-compiled packages on ArchBSD)
I haven't tried it against a current git clone though, only against the version tarball referenced in the PKGBUILD.
from libtorrent.
This is also an issue with FreeBSD, where GCC was removed entirely in favour of Clang.
Someone seems to have created a patch, though:
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/185299
(I'm not the author of this patch, and I didn't test it).
from libtorrent.
I have started work on a C++11 branch, however it is not yet ready.
https://github.com/rakshasa/libtorrent/tree/c++11
from libtorrent.
Both libtorrent and rtorrent now have c++11 branches, which should work with clang.
from libtorrent.
Thank you, I'll test! Is this expected to make it into a future release?
from libtorrent.
The next release, most likely this week or next, will become the stable branch.
The unstable branch will require C++11, mainly because I want to play with the new features and 3 years is enough for the distros to catch up.
from libtorrent.
Merged C++11 branch.
from libtorrent.
I have error when build with xcode6 libtorrent-rasterbar.a
Undefined symbols for architecture i386:
"libtorrent::absolutetime_deprecated_()", referenced from:
libtorrent::session::session(libtorrent::fingerprint const&, int, unsigned int) in main.o
"libtorrent::session::init(std::__1::pair<int, int>, char const*, libtorrent::fingerprint const&, unsigned int)", referenced from:
libtorrent::session::session(libtorrent::fingerprint const&, int, unsigned int) in main.o
"libtorrent::session::start(int)", referenced from:
libtorrent::session::session(libtorrent::fingerprint const&, int, unsigned int) in main.o
"libtorrent::session::~session()", referenced from:
_main in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
from libtorrent.
Related Issues (20)
- Just FYI: rTorrent Crash, 'priority_queue_erase(...) called on an invalid item.' HOT 4
- Build with/without INOTIFY HOT 1
- Regular rtorrent crashes because of DHT HOT 2
- LibTorrentTest fails to build on 13.8 due to multiple definitions. HOT 2
- Crash when rechecking torrents with missing empty files
- 0.13.8: test suite linkinmg fails with LTO
- Support for BEP52 (BitTorrent v2) HOT 1
- libtorrent: FTBFS on hurd-i386: error: 'IPV6_TCLASS' was not declared in this scope. HOT 1
- How to build libtorrent after commit 53596af? HOT 3
- Getting lots of "message:7 network error" on handshake_manager however network is fine
- 'make check' fails with missing sig_t on Solaris
- OpenSSL v3 support for libtorrent
- how to bind a callback function for specific events HOT 1
- Several branches
- New release?
- FR: ipv6 support for UDP trackers
- Commit e22c77f causes rtorrent/rutorrent to crash when setting torrent file priority to not download
- received a chunk that has already been filled
- Commit 0f957c2 breaks rtorrent IPV4 TOS setting.
- libtorrent.so 0.13.8 crash on Rasberry PI4 kernel due to unaligned access HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libtorrent.