BtbN / vlc-htsp-plugin

Plugin for VLC to access TVHeadend via HTSP.
GNU Lesser General Public License v2.1
58 stars 31 forks source link

Incompatible with vlc 2.2.0 #12

Closed LeoIannacone closed 9 years ago

LeoIannacone commented 9 years ago

Hi,

trying to build your plugin against vlc 2.2.0 I get this error:

$ make
g++ -pipe -O2 -Wall -Wextra -std=gnu++0x -I. -g -DMODULE_STRING=\"htsp\" -DVLC_PLUGIN_MAJOR=2 -DVLC_PLUGIN_MINOR=2 -D__PLUGIN__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -I/usr/include/vlc/plugins  -DPIC -fPIC -c vlc-htsp-plugin.cpp
In file included from /usr/include/vlc/plugins/vlc_demux.h:32:0,
                 from vlc-htsp-plugin.cpp:21:
/usr/include/vlc/plugins/vlc_es.h:288:66: error: expected ‘,’ or ‘...’ before ‘out’
 VLC_API void video_format_ApplyRotation(video_format_t *restrict out, const video_format_t *restrict in);
                                                                  ^
In file included from /usr/include/vlc/plugins/vlc_services_discovery.h:27:0,
                 from vlc-htsp-plugin.cpp:23:
/usr/include/vlc/plugins/vlc_input.h: In function ‘int input_AddSubtitleOSD(input_thread_t*, const char*, bool, bool)’:
/usr/include/vlc/plugins/vlc_input.h:568:84: error: ‘_’ was not declared in this scope
         vout_OSDMessage(p_vout, SPU_DEFAULT_CHANNEL, "%s", _("Subtitle track added") );
                                                                                    ^
make: *** [vlc-htsp-plugin.o] Error 1
Makefile:50: recipe for target 'vlc-htsp-plugin.o' failed

System info: Description: Ubuntu Utopic Unicorn (development branch) Linux home 3.16.0-16-generic #22-Ubuntu SMP Wed Sep 17 18:47:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

HombreTriton commented 9 years ago

Me too, I update VLC and now don't work anymore with some error. I'm using Debian testing.

BtbN commented 9 years ago

That's an error in the vlc headers, not sure what i could do about it.

LeoIannacone commented 9 years ago

I have just filed these two bugs against VLC:

LeoIannacone commented 9 years ago

Those bugs are fixed now..

But there are other errors now:

$ make                                                   git:(master) ✗ 
gcc -pipe -O2 -Wall -Wextra -std=gnu99 -I. -g -DMODULE_STRING=\"htsp\" -DVLC_PLUGIN_MAJOR=2 -DVLC_PLUGIN_MINOR=2 -D__PLUGIN__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -I/usr/include/vlc/plugins  -DPIC -fPIC -c sha1.c
g++ -pipe -O2 -Wall -Wextra -std=gnu++0x -I. -g -DMODULE_STRING=\"htsp\" -DVLC_PLUGIN_MAJOR=2 -DVLC_PLUGIN_MINOR=2 -D__PLUGIN__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -I/usr/include/vlc/plugins  -DPIC -fPIC -c vlc-htsp-plugin.cpp
g++ -pipe -O2 -Wall -Wextra -std=gnu++0x -I. -g -DMODULE_STRING=\"htsp\" -DVLC_PLUGIN_MAJOR=2 -DVLC_PLUGIN_MINOR=2 -D__PLUGIN__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -I/usr/include/vlc/plugins  -DPIC -fPIC -c htsmessage.cpp
g++ -pipe -O2 -Wall -Wextra -std=gnu++0x -I. -g -DMODULE_STRING=\"htsp\" -DVLC_PLUGIN_MAJOR=2 -DVLC_PLUGIN_MINOR=2 -D__PLUGIN__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -I/usr/include/vlc/plugins  -DPIC -fPIC -c helper.cpp
g++ -pipe -O2 -Wall -Wextra -std=gnu++0x -I. -g -DMODULE_STRING=\"htsp\" -DVLC_PLUGIN_MAJOR=2 -DVLC_PLUGIN_MINOR=2 -D__PLUGIN__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -I/usr/include/vlc/plugins  -DPIC -fPIC -c access.cpp
In file included from access.cpp:33:0:
/usr/include/c++/4.9/atomic:864:25: error: macro "atomic_compare_exchange_weak_explicit" passed 5 arguments, but takes just 4
        memory_order __m2) noexcept
                         ^
/usr/include/c++/4.9/atomic:872:25: error: macro "atomic_compare_exchange_weak_explicit" passed 5 arguments, but takes just 4
        memory_order __m2) noexcept
                         ^
/usr/include/c++/4.9/atomic:880:27: error: macro "atomic_compare_exchange_strong_explicit" passed 5 arguments, but takes just 4
          memory_order __m2) noexcept
                           ^
/usr/include/c++/4.9/atomic:888:27: error: macro "atomic_compare_exchange_strong_explicit" passed 5 arguments, but takes just 4
          memory_order __m2) noexcept
                           ^
/usr/include/c++/4.9/atomic:929:30: error: macro "atomic_compare_exchange_weak_explicit" passed 5 arguments, but takes just 4
          memory_order_seq_cst);
                              ^
/usr/include/c++/4.9/atomic:939:30: error: macro "atomic_compare_exchange_weak_explicit" passed 5 arguments, but takes just 4
          memory_order_seq_cst);
                              ^
/usr/include/c++/4.9/atomic:949:32: error: macro "atomic_compare_exchange_strong_explicit" passed 5 arguments, but takes just 4
            memory_order_seq_cst);
                                ^
/usr/include/c++/4.9/atomic:959:32: error: macro "atomic_compare_exchange_strong_explicit" passed 5 arguments, but takes just 4
            memory_order_seq_cst);
                                ^
In file included from /usr/include/c++/4.9/atomic:41:0,
                 from access.cpp:33:
/usr/include/c++/4.9/bits/atomic_base.h: In function ‘void std::__sync_synchronize()’:
/usr/include/c++/4.9/bits/atomic_base.h:103:27: error: ‘__m’ was not declared in this scope
   { __atomic_thread_fence(__m); }
                           ^
In file included from /usr/include/vlc/plugins/vlc_picture.h:35:0,
                 from /usr/include/vlc/plugins/vlc_subpicture.h:34,
                 from /usr/include/vlc/plugins/vlc_spu.h:29,
                 from /usr/include/vlc/plugins/vlc_vout_osd.h:29,
                 from /usr/include/vlc/plugins/vlc_input.h:39,
                 from access.cpp:28:
/usr/include/c++/4.9/bits/atomic_base.h: At global scope:
/usr/include/vlc/plugins/vlc_atomic.h:51:7: error: expected unqualified-id before ‘void’
     ((void)0)
       ^
/usr/include/vlc/plugins/vlc_atomic.h:51:7: error: expected ‘)’ before ‘void’
/usr/include/vlc/plugins/vlc_atomic.h:51:7: error: expected ‘)’ before ‘void’
/usr/include/vlc/plugins/vlc_atomic.h:45:7: error: expected unqualified-id before ‘void’
     ((void)0)
       ^
/usr/include/vlc/plugins/vlc_atomic.h:45:7: error: expected ‘)’ before ‘void’
/usr/include/vlc/plugins/vlc_atomic.h:45:7: error: expected ‘)’ before ‘void’
/usr/include/vlc/plugins/vlc_atomic.h:132:2: error: expected unqualified-id before ‘{’ token
 ({  \
  ^
/usr/include/vlc/plugins/vlc_atomic.h:132:2: error: expected ‘)’ before ‘{’ token
/usr/include/vlc/plugins/vlc_atomic.h:139:2: error: expected unqualified-id before ‘)’ token
 })
  ^
/usr/include/vlc/plugins/vlc_atomic.h:132:2: error: expected unqualified-id before ‘{’ token
 ({  \
  ^
/usr/include/vlc/plugins/vlc_atomic.h:132:2: error: expected ‘)’ before ‘{’ token
/usr/include/vlc/plugins/vlc_atomic.h:139:2: error: expected unqualified-id before ‘)’ token
 })
  ^
/usr/include/vlc/plugins/vlc_atomic.h:117:5: error: expected unqualified-id before ‘do’
     do { \
     ^
/usr/include/vlc/plugins/vlc_atomic.h:120:7: error: expected unqualified-id before ‘while’
     } while (0)
       ^
/usr/include/vlc/plugins/vlc_atomic.h:117:5: error: expected unqualified-id before ‘do’
     do { \
     ^
/usr/include/vlc/plugins/vlc_atomic.h:120:7: error: expected unqualified-id before ‘while’
     } while (0)
       ^
/usr/include/vlc/plugins/vlc_atomic.h:132:2: error: expected unqualified-id before ‘{’ token
 ({  \
  ^
/usr/include/vlc/plugins/vlc_atomic.h:132:2: error: expected ‘)’ before ‘{’ token
/usr/include/vlc/plugins/vlc_atomic.h:139:2: error: expected unqualified-id before ‘)’ token
 })
  ^
In file included from /usr/include/c++/4.9/bits/ostream_insert.h:36:0,
                 from /usr/include/c++/4.9/string:44,
                 from helper.h:23,
                 from access.cpp:36:
/usr/include/c++/4.9/bits/cxxabi_forced.h:36:37: error: expected ‘}’ before end of line
 #pragma GCC visibility push(default)
                                     ^
/usr/include/c++/4.9/bits/cxxabi_forced.h:36:37: error: expected declaration before end of line
make: *** [access.o] Error 1
Makefile:50: recipe for target 'access.o' failed

What do you think ?

BtbN commented 9 years ago

Looks like something is wrong with your C++ runtime? No idea where these come from, they all point to external code.

sigurg commented 9 years ago

The issue comes from the order of your includes. vlc_atomic.h (which appearently is included by another vlc header) defines a macro atomic_compare_exchange_weak_explicit which is also used in <atomic>, but with a different number of arguments. Reordering your includes in access.cpp, so #include <atomic> is above the vlc headers fixes the problems (imho it's always a good idea to put system headers first).