Discussion:
[libtorrent] Build bugs, latest master
Michael Mckeown
2016-08-20 17:27:35 UTC
Permalink
C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(73):
warning C4003: not enough actual parameters for macro 'max'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(73):
error C2059: syntax error: '('
1>C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(73):
error C2143: syntax error: missing ',' before '?'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(73):
error C2535: 'libtorrent::sha1_hash::sha1_hash(void)': member function
already defined or declared
1> C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(68):
note: see declaration of 'libtorrent::sha1_hash::sha1_hash'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(73):
error C2059: syntax error: '?'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(73):
error C2059: syntax error: '{'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(73):
error C2334: unexpected token(s) preceding '{'; skipping apparent
function body
1>C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(83):
warning C4003: not enough actual parameters for macro 'min'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(83):
error C2059: syntax error: '('
1>C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(83):
error C2143: syntax error: missing ',' before '?'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(83):
error C2535: 'libtorrent::sha1_hash::sha1_hash(void)': member function
already defined or declared
1> C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(68):
note: see declaration of 'libtorrent::sha1_hash::sha1_hash'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(83):
error C2059: syntax error: '?'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(83):
error C2059: syntax error: '{'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/sha1_hash.hpp(83):
error C2334: unexpected token(s) preceding '{'; skipping apparent
function body
1>C:\Libtorrent\libtorrent-master\include\libtorrent/bandwidth_limit.hpp(46):
warning C4003: not enough actual parameters for macro 'max'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/bandwidth_limit.hpp(46):
error C2589: '(': illegal token on right side of '::'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/bandwidth_limit.hpp(46):
error C2059: syntax error: '::'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/bandwidth_limit.hpp(46):
error C2737: 'public: static int const
libtorrent::bandwidth_channel::inf': 'constexpr' object must be initialized
1>C:\Libtorrent\libtorrent-master\include\libtorrent/bandwidth_limit.hpp(46):
fatal error C1903: unable to recover from previous error(s); stopping
compilation

Built on Windows.
------------------------------------------------------------------------------
Arvid Norberg
2016-08-21 00:40:32 UTC
Permalink
master requires C++11, which on windows means msvc-14.0 (2015).

Which compiler and version are you building with?

I don't see any reference to a .cpp file those header files are being
included from. This error happens because windows.h (used to) define two
macros, min and max. Traditionally, the wayt this is dealt with is
preventing macro substitution by adding parenthesis around min and max.
Like this: (std::max)(a,b). Recently however, we've stopped doing that, as
it seems msvc-14.0 builds fine anyway.

Are you including windows.h in a way that still defines those macros?
Post by Michael Mckeown
warning C4003: not enough actual parameters for macro 'max'
error C2059: syntax error: '('
error C2143: syntax error: missing ',' before '?'
error C2535: 'libtorrent::sha1_hash::sha1_hash(void)': member function
already defined or declared
note: see declaration of 'libtorrent::sha1_hash::sha1_hash'
error C2059: syntax error: '?'
error C2059: syntax error: '{'
error C2334: unexpected token(s) preceding '{'; skipping apparent
function body
warning C4003: not enough actual parameters for macro 'min'
error C2059: syntax error: '('
error C2143: syntax error: missing ',' before '?'
error C2535: 'libtorrent::sha1_hash::sha1_hash(void)': member function
already defined or declared
note: see declaration of 'libtorrent::sha1_hash::sha1_hash'
error C2059: syntax error: '?'
error C2059: syntax error: '{'
error C2334: unexpected token(s) preceding '{'; skipping apparent
function body
1>C:\Libtorrent\libtorrent-master\include\libtorrent/
warning C4003: not enough actual parameters for macro 'max'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/
error C2589: '(': illegal token on right side of '::'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/
error C2059: syntax error: '::'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/
error C2737: 'public: static int const
libtorrent::bandwidth_channel::inf': 'constexpr' object must be initialized
1>C:\Libtorrent\libtorrent-master\include\libtorrent/
fatal error C1903: unable to recover from previous error(s); stopping
compilation
Built on Windows.
------------------------------------------------------------
------------------
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
--
Arvid Norberg
------------------------------------------------------------------------------
Michael Mckeown
2016-08-21 10:43:14 UTC
Permalink
Sorry, libtorrent.lib is built this is the Visual Studio compiling of
the application linked with libtorrent.lib.

Using VS 2015 (update 3) and windows.h is included as the first include
of stdafx.h.

#define NOMINMAX fixed the problem, thanks.
Post by Arvid Norberg
master requires C++11, which on windows means msvc-14.0 (2015).
Which compiler and version are you building with?
I don't see any reference to a .cpp file those header files are being
included from. This error happens because windows.h (used to) define two
macros, min and max. Traditionally, the wayt this is dealt with is
preventing macro substitution by adding parenthesis around min and max.
Like this: (std::max)(a,b). Recently however, we've stopped doing that, as
it seems msvc-14.0 builds fine anyway.
Are you including windows.h in a way that still defines those macros?
Post by Michael Mckeown
warning C4003: not enough actual parameters for macro 'max'
error C2059: syntax error: '('
error C2143: syntax error: missing ',' before '?'
error C2535: 'libtorrent::sha1_hash::sha1_hash(void)': member function
already defined or declared
note: see declaration of 'libtorrent::sha1_hash::sha1_hash'
error C2059: syntax error: '?'
error C2059: syntax error: '{'
error C2334: unexpected token(s) preceding '{'; skipping apparent
function body
warning C4003: not enough actual parameters for macro 'min'
error C2059: syntax error: '('
error C2143: syntax error: missing ',' before '?'
error C2535: 'libtorrent::sha1_hash::sha1_hash(void)': member function
already defined or declared
note: see declaration of 'libtorrent::sha1_hash::sha1_hash'
error C2059: syntax error: '?'
error C2059: syntax error: '{'
error C2334: unexpected token(s) preceding '{'; skipping apparent
function body
1>C:\Libtorrent\libtorrent-master\include\libtorrent/
warning C4003: not enough actual parameters for macro 'max'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/
error C2589: '(': illegal token on right side of '::'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/
error C2059: syntax error: '::'
1>C:\Libtorrent\libtorrent-master\include\libtorrent/
error C2737: 'public: static int const
libtorrent::bandwidth_channel::inf': 'constexpr' object must be initialized
1>C:\Libtorrent\libtorrent-master\include\libtorrent/
fatal error C1903: unable to recover from previous error(s); stopping
compilation
Built on Windows.
------------------------------------------------------------
------------------
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
------------------------------------------------------------------------------
M***@massaroddel.de
2016-08-21 05:57:24 UTC
Permalink
Post by Michael Mckeown
warning C4003: not enough actual parameters for macro 'max'
error C2059: syntax error: '('
error C2143: syntax error: missing ',' before '?'
error C2535: 'libtorrent::sha1_hash::sha1_hash(void)': member function
already defined or declared
note: see declaration of 'libtorrent::sha1_hash::sha1_hash'
error C2059: syntax error: '?'
error C2059: syntax error: '{'
error C2334: unexpected token(s) preceding '{'; skipping apparent
function body
warning C4003: not enough actual parameters for macro 'min'
error C2059: syntax error: '('
error C2143: syntax error: missing ',' before '?'
error C2535: 'libtorrent::sha1_hash::sha1_hash(void)': member function
already defined or declared
note: see declaration of 'libtorrent::sha1_hash::sha1_hash'
error C2059: syntax error: '?'
error C2059: syntax error: '{'
error C2334: unexpected token(s) preceding '{'; skipping apparent
function body
warning C4003: not enough actual parameters for macro 'max'
error C2589: '(': illegal token on right side of '::'
error C2059: syntax error: '::'
error C2737: 'public: static int const
libtorrent::bandwidth_channel::inf': 'constexpr' object must be initialized
fatal error C1903: unable to recover from previous error(s); stopping
compilation
Built on Windows.
------------------------------------------------------------------------------
Did you forget to define NOMINMAX?


MassaRoddel


------------------------------------------------------------------------------
Continue reading on narkive:
Loading...