Pulse-Eight / libcec

USB CEC Adapter communication Library http://libcec.pulse-eight.com/
Other
714 stars 287 forks source link

Compile error "No such file or directory " A quick search tells me its there .... #516

Closed Electrik-rich546456 closed 4 years ago

Electrik-rich546456 commented 4 years ago

Hi there ive been trying to compile this on ubuntu 19 for a while. I am so close but getting a silliy error, How do i fix it ?

Here is the terminal output but the important lines as far as i can tell is this one

/home/user/libcec/src/libcec/adapter/Linux/LinuxCECAdapterCommunication.cpp:46:10: fatal error: linux/cec.h: No such file or directory
   46 | #include <linux/cec.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/libcec/CMakeFiles/cec.dir/build.make:128: src/libcec/CMakeFiles/cec.dir/adapter/Linux/LinuxCECAdapterCommunication.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:254: src/libcec/CMakeFiles/cec.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Full terminal output:

user@user-pc:~$ cd libcec/build
user@user-pc:~/libcec/build$ cmake -DHAVE_LINUX_API=1 ..
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test SUPPORTS_CXX11
-- Performing Test SUPPORTS_CXX11 - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Looking for initscr in curses
-- Looking for initscr in curses - found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.7m.so (found version "3.7.5") 
-- git found: libcec-4.0.4+61-4ef0486
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Looking for include file sys/file.h
-- Looking for include file sys/file.h - found
-- Looking for flock
-- Looking for flock - found
-- Checking for module 'udev'
--   Found udev, version 242
-- Looking for 3 include files X11/Xlib.h, ..., X11/extensions/Xrandr.h
-- Looking for 3 include files X11/Xlib.h, ..., X11/extensions/Xrandr.h - found
-- Looking for XRRGetScreenResources in Xrandr
-- Looking for XRRGetScreenResources in Xrandr - found
-- Looking for bcm_host_init in bcm_host
-- Looking for bcm_host_init in bcm_host - not found
-- Looking for include files tda998x_ioctl.h, comps/tmdlHdmiCEC/inc/tmdlHdmiCEC_Types.h
-- Looking for include files tda998x_ioctl.h, comps/tmdlHdmiCEC/inc/tmdlHdmiCEC_Types.h - not found
-- Found SWIG: /usr/bin/swig3.0 (found version "3.0.12") 
-- Configured features:
-- Pulse-Eight CEC Adapter:                yes
-- Pulse-Eight CEC Adapter detection:      yes
-- xrandr support:                         yes
-- Raspberry Pi support:                   no
-- TDA995x support:                        no
-- Exynos support:                         no
-- DRM support:                            yes
-- Linux support:                          yes
-- AOCEC support:                          no
-- i.MX6 support:                          no
-- Python support:                         version 3.7.5 (3.7)
-- lib info: git revision: libcec-4.0.4+61-4ef0486, compiled on 2020-06-10 15:08:51 by user@user-pc on Linux 5.3.0-46-generic (x86_64), features: P8_USB, DRM, P8_detect, randr, Linux
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/libcec/build
user@user-pc:~/libcec/build$ make -j4
Scanning dependencies of target cec_swig_compilation
Scanning dependencies of target cec
[  2%] Swig compile libcec.i for python
[  7%] Building CXX object src/libcec/CMakeFiles/cec.dir/CECClient.cpp.o
[  7%] Building CXX object src/libcec/CMakeFiles/cec.dir/CECProcessor.cpp.o
[  9%] Building CXX object src/libcec/CMakeFiles/cec.dir/LibCEC.cpp.o
In file included from /home/user/libcec/src/libcec/CECProcessor.h:41,
                 from /home/user/libcec/src/libcec/CECProcessor.cpp:35:
/home/user/libcec/src/libcec/CECInputBuffer.h: In member function ‘bool CEC::CCECInputBuffer::Push(const cec_command&)’:
/home/user/libcec/src/libcec/CECInputBuffer.h:64:44: warning: implicitly-declared ‘constexpr CEC::cec_command::cec_command(const CEC::cec_command&)’ is deprecated [-Wdeprecated-copy]
   64 |         bReturn = m_tvInBuffer.Push(command);
      |                                            ^
In file included from /home/user/libcec/src/libcec/env.h:36,
                 from /home/user/libcec/src/libcec/CECProcessor.cpp:34:
/home/user/libcec/src/libcec/../../include/cectypes.h:1068:16: note: because ‘CEC::cec_command’ has user-provided ‘CEC::cec_command& CEC::cec_command::operator=(const CEC::cec_command&)’
 1068 |   cec_command &operator =(const struct cec_command &command)
      |                ^~~~~~~~
In file included from /home/user/libcec/src/libcec/CECProcessor.h:38,
                 from /home/user/libcec/src/libcec/CECProcessor.cpp:35:
/usr/local/include/p8-platform/util/buffer.h:73:24: note:   initializing argument 1 of ‘bool P8PLATFORM::SyncedBuffer<_BType>::Push(_BType) [with _BType = CEC::cec_command]’
   73 |       bool Push(_BType entry)
      |                 ~~~~~~~^~~~~
In file included from /home/user/libcec/src/libcec/CECProcessor.h:41,
                 from /home/user/libcec/src/libcec/CECProcessor.cpp:35:
/home/user/libcec/src/libcec/CECInputBuffer.h:66:42: warning: implicitly-declared ‘constexpr CEC::cec_command::cec_command(const CEC::cec_command&)’ is deprecated [-Wdeprecated-copy]
   66 |         bReturn = m_inBuffer.Push(command);
      |                                          ^
In file included from /home/user/libcec/src/libcec/env.h:36,
                 from /home/user/libcec/src/libcec/CECProcessor.cpp:34:
/home/user/libcec/src/libcec/../../include/cectypes.h:1068:16: note: because ‘CEC::cec_command’ has user-provided ‘CEC::cec_command& CEC::cec_command::operator=(const CEC::cec_command&)’
 1068 |   cec_command &operator =(const struct cec_command &command)
      |                ^~~~~~~~
In file included from /home/user/libcec/src/libcec/CECProcessor.h:38,
                 from /home/user/libcec/src/libcec/CECProcessor.cpp:35:
/usr/local/include/p8-platform/util/buffer.h:73:24: note:   initializing argument 1 of ‘bool P8PLATFORM::SyncedBuffer<_BType>::Push(_BType) [with _BType = CEC::cec_command]’
   73 |       bool Push(_BType entry)
      |                 ~~~~~~~^~~~~
In file included from /home/user/libcec/src/libcec/CECClient.cpp:35:
/home/user/libcec/src/libcec/CECClient.h: In constructor ‘CEC::CCallbackWrap::CCallbackWrap(const cec_command&)’:
/home/user/libcec/src/libcec/CECClient.h:64:25: warning: implicitly-declared ‘constexpr CEC::cec_command::cec_command(const CEC::cec_command&)’ is deprecated [-Wdeprecated-copy]
   64 |       m_bSucceeded(false) {}
      |                         ^
In file included from /home/user/libcec/src/libcec/env.h:36,
                 from /home/user/libcec/src/libcec/CECClient.cpp:34:
/home/user/libcec/src/libcec/../../include/cectypes.h:1068:16: note: because ‘CEC::cec_command’ has user-provided ‘CEC::cec_command& CEC::cec_command::operator=(const CEC::cec_command&)’
 1068 |   cec_command &operator =(const struct cec_command &command)
      |                ^~~~~~~~
In file included from /home/user/libcec/src/libcec/CECProcessor.h:41,
                 from /home/user/libcec/src/libcec/CECClient.cpp:37:
/home/user/libcec/src/libcec/CECInputBuffer.h: In member function ‘bool CEC::CCECInputBuffer::Push(const cec_command&)’:
/home/user/libcec/src/libcec/CECInputBuffer.h:64:44: warning: implicitly-declared ‘constexpr CEC::cec_command::cec_command(const CEC::cec_command&)’ is deprecated [-Wdeprecated-copy]
   64 |         bReturn = m_tvInBuffer.Push(command);
      |                                            ^
In file included from /home/user/libcec/src/libcec/env.h:36,
                 from /home/user/libcec/src/libcec/CECClient.cpp:34:
/home/user/libcec/src/libcec/../../include/cectypes.h:1068:16: note: because ‘CEC::cec_command’ has user-provided ‘CEC::cec_command& CEC::cec_command::operator=(const CEC::cec_command&)’
 1068 |   cec_command &operator =(const struct cec_command &command)
      |                ^~~~~~~~
In file included from /home/user/libcec/src/libcec/LibCEC.h:38,
                 from /home/user/libcec/src/libcec/CECClient.h:36,
                 from /home/user/libcec/src/libcec/CECClient.cpp:35:
/usr/local/include/p8-platform/util/buffer.h:73:24: note:   initializing argument 1 of ‘bool P8PLATFORM::SyncedBuffer<_BType>::Push(_BType) [with _BType = CEC::cec_command]’
   73 |       bool Push(_BType entry)
      |                 ~~~~~~~^~~~~
In file included from /home/user/libcec/src/libcec/CECProcessor.h:41,
                 from /home/user/libcec/src/libcec/CECClient.cpp:37:
/home/user/libcec/src/libcec/CECInputBuffer.h:66:42: warning: implicitly-declared ‘constexpr CEC::cec_command::cec_command(const CEC::cec_command&)’ is deprecated [-Wdeprecated-copy]
   66 |         bReturn = m_inBuffer.Push(command);
      |                                          ^
In file included from /home/user/libcec/src/libcec/env.h:36,
                 from /home/user/libcec/src/libcec/CECClient.cpp:34:
/home/user/libcec/src/libcec/../../include/cectypes.h:1068:16: note: because ‘CEC::cec_command’ has user-provided ‘CEC::cec_command& CEC::cec_command::operator=(const CEC::cec_command&)’
 1068 |   cec_command &operator =(const struct cec_command &command)
      |                ^~~~~~~~
In file included from /home/user/libcec/src/libcec/LibCEC.h:38,
                 from /home/user/libcec/src/libcec/CECClient.h:36,
                 from /home/user/libcec/src/libcec/CECClient.cpp:35:
/usr/local/include/p8-platform/util/buffer.h:73:24: note:   initializing argument 1 of ‘bool P8PLATFORM::SyncedBuffer<_BType>::Push(_BType) [with _BType = CEC::cec_command]’
   73 |       bool Push(_BType entry)
      |                 ~~~~~~~^~~~~
In file included from /home/user/libcec/src/libcec/CECProcessor.h:41,
                 from /home/user/libcec/src/libcec/LibCEC.cpp:39:
/home/user/libcec/src/libcec/CECInputBuffer.h: In member function ‘bool CEC::CCECInputBuffer::Push(const cec_command&)’:
/home/user/libcec/src/libcec/CECInputBuffer.h:64:44: warning: implicitly-declared ‘constexpr CEC::cec_command::cec_command(const CEC::cec_command&)’ is deprecated [-Wdeprecated-copy]
   64 |         bReturn = m_tvInBuffer.Push(command);
      |                                            ^
In file included from /home/user/libcec/src/libcec/env.h:36,
                 from /home/user/libcec/src/libcec/LibCEC.cpp:34:
/home/user/libcec/src/libcec/../../include/cectypes.h:1068:16: note: because ‘CEC::cec_command’ has user-provided ‘CEC::cec_command& CEC::cec_command::operator=(const CEC::cec_command&)’
 1068 |   cec_command &operator =(const struct cec_command &command)
      |                ^~~~~~~~
In file included from /home/user/libcec/src/libcec/LibCEC.h:38,
                 from /home/user/libcec/src/libcec/LibCEC.cpp:35:
/usr/local/include/p8-platform/util/buffer.h:73:24: note:   initializing argument 1 of ‘bool P8PLATFORM::SyncedBuffer<_BType>::Push(_BType) [with _BType = CEC::cec_command]’
   73 |       bool Push(_BType entry)
      |                 ~~~~~~~^~~~~
In file included from /home/user/libcec/src/libcec/CECProcessor.h:41,
                 from /home/user/libcec/src/libcec/LibCEC.cpp:39:
/home/user/libcec/src/libcec/CECInputBuffer.h:66:42: warning: implicitly-declared ‘constexpr CEC::cec_command::cec_command(const CEC::cec_command&)’ is deprecated [-Wdeprecated-copy]
   66 |         bReturn = m_inBuffer.Push(command);
      |                                          ^
In file included from /home/user/libcec/src/libcec/env.h:36,
                 from /home/user/libcec/src/libcec/LibCEC.cpp:34:
/home/user/libcec/src/libcec/../../include/cectypes.h:1068:16: note: because ‘CEC::cec_command’ has user-provided ‘CEC::cec_command& CEC::cec_command::operator=(const CEC::cec_command&)’
 1068 |   cec_command &operator =(const struct cec_command &command)
      |                ^~~~~~~~
In file included from /home/user/libcec/src/libcec/LibCEC.h:38,
                 from /home/user/libcec/src/libcec/LibCEC.cpp:35:
/usr/local/include/p8-platform/util/buffer.h:73:24: note:   initializing argument 1 of ‘bool P8PLATFORM::SyncedBuffer<_BType>::Push(_BType) [with _BType = CEC::cec_command]’
   73 |       bool Push(_BType entry)
      |                 ~~~~~~~^~~~~
In file included from /home/user/libcec/src/libcec/CECProcessor.cpp:46:
/home/user/libcec/src/libcec/CECClient.h: In constructor ‘CEC::CCallbackWrap::CCallbackWrap(const cec_command&)’:
/home/user/libcec/src/libcec/CECClient.h:64:25: warning: implicitly-declared ‘constexpr CEC::cec_command::cec_command(const CEC::cec_command&)’ is deprecated [-Wdeprecated-copy]
   64 |       m_bSucceeded(false) {}
      |                         ^
In file included from /home/user/libcec/src/libcec/env.h:36,
                 from /home/user/libcec/src/libcec/CECProcessor.cpp:34:
/home/user/libcec/src/libcec/../../include/cectypes.h:1068:16: note: because ‘CEC::cec_command’ has user-provided ‘CEC::cec_command& CEC::cec_command::operator=(const CEC::cec_command&)’
 1068 |   cec_command &operator =(const struct cec_command &command)
      |                ^~~~~~~~
In file included from /home/user/libcec/src/libcec/LibCEC.cpp:49:
/home/user/libcec/src/libcec/CECClient.h: In constructor ‘CEC::CCallbackWrap::CCallbackWrap(const cec_command&)’:
/home/user/libcec/src/libcec/CECClient.h:64:25: warning: implicitly-declared ‘constexpr CEC::cec_command::cec_command(const CEC::cec_command&)’ is deprecated [-Wdeprecated-copy]
   64 |       m_bSucceeded(false) {}
      |                         ^
In file included from /home/user/libcec/src/libcec/env.h:36,
                 from /home/user/libcec/src/libcec/LibCEC.cpp:34:
/home/user/libcec/src/libcec/../../include/cectypes.h:1068:16: note: because ‘CEC::cec_command’ has user-provided ‘CEC::cec_command& CEC::cec_command::operator=(const CEC::cec_command&)’
 1068 |   cec_command &operator =(const struct cec_command &command)
      |                ^~~~~~~~
/home/user/libcec/src/libcec/CECProcessor.cpp: In member function ‘bool CEC::CCECProcessor::Transmit(const cec_command&, bool)’:
/home/user/libcec/src/libcec/CECProcessor.cpp:459:32: warning: implicitly-declared ‘constexpr CEC::cec_command::cec_command(const CEC::cec_command&)’ is deprecated [-Wdeprecated-copy]
  459 |   cec_command transmitData(data);
      |                                ^
In file included from /home/user/libcec/src/libcec/env.h:36,
                 from /home/user/libcec/src/libcec/CECProcessor.cpp:34:
/home/user/libcec/src/libcec/../../include/cectypes.h:1068:16: note: because ‘CEC::cec_command’ has user-provided ‘CEC::cec_command& CEC::cec_command::operator=(const CEC::cec_command&)’
 1068 |   cec_command &operator =(const struct cec_command &command)
      |                ^~~~~~~~
/home/user/libcec/src/libcec/LibCEC.cpp: In member function ‘virtual CEC::cec_command CEC::CLibCEC::CommandFromString(const char*)’:
/home/user/libcec/src/libcec/LibCEC.cpp:612:10: warning: implicitly-declared ‘constexpr CEC::cec_command::cec_command(const CEC::cec_command&)’ is deprecated [-Wdeprecated-copy]
  612 |   return retval;
      |          ^~~~~~
In file included from /home/user/libcec/src/libcec/env.h:36,
                 from /home/user/libcec/src/libcec/LibCEC.cpp:34:
/home/user/libcec/src/libcec/../../include/cectypes.h:1068:16: note: because ‘CEC::cec_command’ has user-provided ‘CEC::cec_command& CEC::cec_command::operator=(const CEC::cec_command&)’
 1068 |   cec_command &operator =(const struct cec_command &command)
      |                ^~~~~~~~
[ 11%] Building CXX object src/libcec/CMakeFiles/cec.dir/LibCECC.cpp.o
[ 11%] Built target cec_swig_compilation
[ 14%] Building CXX object src/libcec/CMakeFiles/cec.dir/adapter/Linux/LinuxCECAdapterDetection.cpp.o
[ 16%] Building CXX object src/libcec/CMakeFiles/cec.dir/adapter/Linux/LinuxCECAdapterCommunication.cpp.o
/home/user/libcec/src/libcec/adapter/Linux/LinuxCECAdapterCommunication.cpp:46:10: fatal error: linux/cec.h: No such file or directory
   46 | #include <linux/cec.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/libcec/CMakeFiles/cec.dir/build.make:128: src/libcec/CMakeFiles/cec.dir/adapter/Linux/LinuxCECAdapterCommunication.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:254: src/libcec/CMakeFiles/cec.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
opdenkamp commented 4 years ago

the warning should be gone when you pull the latest version. those got added in gcc9

the problem is that it thinks that it can build CEC in-kernel support: -- Linux support: yes

but it can't find the kernel headers in your search path.

install the kernel headers and tell cmake where they are if it can't find them still