MyrikLD / LinusTrinus

TrinusVR streaming server for Linux
128 stars 16 forks source link

error: invalid new-expression of abstract class type ‘CSampleDeviceDriver’ #55

Open notwithering opened 5 months ago

notwithering commented 5 months ago

when attempting to compile, i get the error: invalid new-expression of abstract class type ‘CSampleDeviceDriver’

output from make.sh:

└[$]> ./make.sh
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Compilation set for 64bits architectures.
CMake Warning (dev) at /usr/share/cmake/Modules/FindOpenGL.cmake:381 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:106 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenGL: /usr/lib/libOpenGL.so   
-- Found GLEW: /usr/include (found suitable version "2.2.0", minimum required is "1.11") 
-- Configuring done (0.6s)
-- Generating done (0.0s)
-- Build files have been written to: /home/withering/tmp/LinusTrinus/samples
[  0%] Built target driver_linus_trinus_autogen_timestamp_deps
[ 12%] Automatic MOC and UIC for target driver_linus_trinus
[ 12%] Built target driver_linus_trinus_autogen
[ 37%] Building CXX object driver_linus_trinus/CMakeFiles/driver_linus_trinus.dir/driver_linus_trinus.cpp.o
[ 37%] Building CXX object driver_linus_trinus/CMakeFiles/driver_linus_trinus.dir/driverlog.cpp.o
[ 62%] Building CXX object driver_linus_trinus/CMakeFiles/driver_linus_trinus.dir/driver_linus_trinus_autogen/mocs_compilation.cpp.o
[ 62%] Building CXX object driver_linus_trinus/CMakeFiles/driver_linus_trinus.dir/watchdog.cpp.o
[ 75%] Building CXX object driver_linus_trinus/CMakeFiles/driver_linus_trinus.dir/socket_process.cpp.o
/home/withering/tmp/LinusTrinus/samples/driver_linus_trinus/driver_linus_trinus.cpp: In member function ‘virtual vr::EVRInitError CServerDriver_Sample::Init(vr::IVRDriverContext*)’:
/home/withering/tmp/LinusTrinus/samples/driver_linus_trinus/driver_linus_trinus.cpp:259:52: error: invalid new-expression of abstract class type ‘CSampleDeviceDriver’
  259 |         m_pNullHmdLatest = new CSampleDeviceDriver();
      |                                                    ^
/home/withering/tmp/LinusTrinus/samples/driver_linus_trinus/driver_linus_trinus.cpp:38:7: note:   because the following virtual functions are pure within ‘CSampleDeviceDriver’:
   38 | class CSampleDeviceDriver : public vr::ITrackedDeviceServerDriver, public vr::IVRDisplayComponent {
      |       ^~~~~~~~~~~~~~~~~~~
In file included from /home/withering/tmp/LinusTrinus/samples/driver_linus_trinus/watchdog.h:4,
                 from /home/withering/tmp/LinusTrinus/samples/driver_linus_trinus/driver_linus_trinus.h:4,
                 from /home/withering/tmp/LinusTrinus/samples/driver_linus_trinus/driver_linus_trinus.cpp:3:
/usr/include/openvr/openvr_driver.h:2902:30: note:     ‘virtual bool vr::IVRDisplayComponent::ComputeInverseDistortion(vr::HmdVector2_t*, vr::EVREye, uint32_t, float, float)’
 2902 |                 virtual bool ComputeInverseDistortion( HmdVector2_t *pResult, EVREye eEye, uint32_t unChannel, float fU, float fV ) = 0;
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [driver_linus_trinus/CMakeFiles/driver_linus_trinus.dir/build.make:111: driver_linus_trinus/CMakeFiles/driver_linus_trinus.dir/driver_linus_trinus.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:101: driver_linus_trinus/CMakeFiles/driver_linus_trinus.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
mennodoor commented 1 month ago

I have the same compiling error. One could just implement a dummy function, I am just not sure if there is a different underlying problem...

notwithering commented 1 month ago

almost 4 months later, still have this problem.