y500 / libtorrent

Automatically exported from code.google.com/p/libtorrent
0 stars 0 forks source link

Compilation error w/ BOOST_ATOMIC_LLONG_LOCK_FREE != 2 #740

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm trying to compile libtorrent trunk on iOS (without an additional build 
script, but could reproduce with ./configure && make as well, when 
BOOST_ATOMIC_LLONG_LOCK_FREE != 2).

In file included from 
/Users/jan/projects/ios/torrada/libtorrent/src/piece_picker.cpp:50:
/Users/jan/projects/ios/torrada/libtorrent/include/libtorrent/performance_counte
rs.hpp:458:9: error: unknown type name 'mutex'; did you mean 'std::mutex'?
        mutex m_mutex;
        ^~~~~

as far as I can tell mutex is not defined as type or typedef in 
performance_counters.hpp or any other included files. it is defined in 
libtorrent/thread.hpp but this file is not included in performance_counters.hpp.

Original issue reported on code.google.com by jan.ber...@gmail.com on 30 Apr 2015 at 7:39

GoogleCodeExporter commented 8 years ago
thanks, fixed!

Original comment by arvid.no...@gmail.com on 30 Apr 2015 at 10:38

GoogleCodeExporter commented 8 years ago
arvid, thanks for the quick reply, but now i'm getting these errors:

Users/jan/projects/ios/torrada/libtorrent/src/performance_counters.cpp:64:22: 
error: no matching constructor for initialization of 'mutex::scoped_lock' (aka 
'scoped_lock<boost::asio::detail::posix_mutex>')
                mutex::scoped_lock l(c.m_mutex);
                                   ^ ~~~~~~~~~
In file included from 
/Users/jan/projects/ios/torrada/libtorrent/src/performance_counters.cpp:33:
In file included from 
/Users/jan/projects/ios/torrada/libtorrent/include/libtorrent/performance_counte
rs.hpp:37:
In file included from 
/Users/jan/projects/ios/torrada/libtorrent/include/libtorrent/thread.hpp:54:
In file included from 
/Users/jan/projects/ios/torrada/boost/ios/framework/boost.framework/Headers/asio
/detail/mutex.hpp:25:
In file included from 
/Users/jan/projects/ios/torrada/boost/ios/framework/boost.framework/Headers/asio
/detail/posix_mutex.hpp:24:
/Users/jan/projects/ios/torrada/boost/ios/framework/boost.framework/Headers/asio
/detail/scoped_lock.hpp:28:7: note: candidate constructor (the implicit copy 
constructor) not viable: no known conversion from 'const mutex' (aka 'const 
boost::asio::detail::posix_mutex') to 'const 
boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>' for 1st 
argument
class scoped_lock
      ^
/Users/jan/projects/ios/torrada/boost/ios/framework/boost.framework/Headers/asio
/detail/scoped_lock.hpp:43:12: note: candidate constructor not viable: 1st 
argument ('const mutex' (aka 'const boost::asio::detail::posix_mutex')) would 
lose const qualifier
  explicit scoped_lock(Mutex& m)
           ^
/Users/jan/projects/ios/torrada/boost/ios/framework/boost.framework/Headers/asio
/detail/scoped_lock.hpp:36:3: note: candidate constructor not viable: requires 
2 arguments, but 1 was provided
  scoped_lock(Mutex& m, adopt_lock_t)
  ^

Original comment by jan.ber...@gmail.com on 1 May 2015 at 3:21

GoogleCodeExporter commented 8 years ago
looks like this is a problem when compiling with boost 1.58. what's the 
recommended/supported version?

Original comment by jan.ber...@gmail.com on 1 May 2015 at 9:45

GoogleCodeExporter commented 8 years ago
I build with 1.57, but this looks like another libtorrent error (that may have 
been tickled by the new boost version).

I checked in an attempt to fix this to trunk

Original comment by arvid.no...@gmail.com on 1 May 2015 at 10:20

GoogleCodeExporter commented 8 years ago
thanks, current trunk almost builds with 1.58 now, last error i get is:

/Users/jan/projects/ios/torrada/libtorrent/src/performance_counters.cpp:79:22: 
error: redefinition of 'l'
                mutex::scoped_lock l(c.m_mutex);
                                   ^
/Users/jan/projects/ios/torrada/libtorrent/src/performance_counters.cpp:78:22: 
note: previous definition is here
                mutex::scoped_lock l(m_mutex);

(clang version Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 
3.6.0svn)

after renaming the variable everything compiles and works ok.

Original comment by jan.ber...@gmail.com on 3 May 2015 at 10:56

GoogleCodeExporter commented 8 years ago
sorry about that. I thought I had tried to compile this path, but apparently 
I've failed so far. It should be fixed in [11039].

Original comment by arvid.no...@gmail.com on 3 May 2015 at 10:21

GoogleCodeExporter commented 8 years ago
yep, all works now, thanks!

Original comment by jan.ber...@gmail.com on 4 May 2015 at 5:11