Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Anonymous's avatar
Anonymous
9 years ago
Solved

Failed to compile LibOVRKernel

Hello,

I was using an old v0.8 SDK and I decided to apply the newest SDK. I have encountered many errors and crushed most of them, but one last issue bothers me to run my application. When I try to compile LibOVRKernel project on VS2013, it says it cannot find OVR_ThreadCommandQueue.cpp and .h files. As it says, I couldn't find them from the downloaded SDK directory. They should be in LibOVRKernel\Src\Kernel, but they aren't. 

I also tried to remove them from the Solution Explorer and got new errors such as
    error C2039: 'thread' : is not a member of 'std' (..\..\..\Src\Util\Util_LongPollThread.cpp)

for some codes, for instance,
    std::unique_ptr<std::thread> WatchdogThreadHandle;

In the meantime, VS generates another errors regarding a class named _Pad defined in xthread.
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\thr/xthread(172): error C4265: 'std::_Pad' : class has virtual functions, but destructor is not virtual
1>           instances of this class may not be destructed correctly (..\..\..\Src\Kernel\OVR_Error.cpp)
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\thr/xthread(172): error C4265: 'std::_Pad' : class has virtual functions, but destructor is not virtual
1>           instances of this class may not be destructed correctly (..\..\..\Src\Kernel\OVR_DebugHelp.cpp)
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\thr/xthread(172): error C4265: 'std::_Pad' : class has virtual functions, but destructor is not virtual
1>           instances of this class may not be destructed correctly (..\..\..\Src\Kernel\OVR_Log.cpp)
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\thr/xthread(172): error C4265: 'std::_Pad' : class has virtual functions, but destructor is not virtual
1>           instances of this class may not be destructed correctly (..\..\..\Src\Kernel\OVR_System.cpp)
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\thr/xthread(172): error C4265: 'std::_Pad' : class has virtual functions, but destructor is not virtual
1>           instances of this class may not be destructed correctly (..\..\..\Src\Kernel\OVR_Allocator.cpp)
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\thr/xthread(172): error C4265: 'std::_Pad' : class has virtual functions, but destructor is not virtual
1>           instances of this class may not be destructed correctly (..\..\..\Src\Kernel\OVR_ThreadsWinAPI.cpp)
1>  Util_Watchdog.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\thr/xthread(172): error C4265: 'std::_Pad' : class has virtual functions, but destructor is not virtual
1>           instances of this class may not be destructed correctly (..\..\..\Src\Util\Util_LongPollThread.cpp)
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\thr/xthread(172): error C4265: 'std::_Pad' : class has virtual functions, but destructor is not virtual
1>           instances of this class may not be destructed correctly (..\..\..\Src\Util\Util_SystemInfo.cpp)
The problmatic _Pad class is defined as
class _CRTIMP2_PURE _Pad
{ // base class for launching threads
public:
_Pad();
~_Pad() _NOEXCEPT;
void _Launch(_Thrd_t *_Thr);
void _Release();
virtual unsigned _Go() = 0;

private:
_Cnd_t _Cond;
_Mtx_t _Mtx;
bool _Started;
};

Does anybody have encountered similar issue? Any comment would be helpful. Thank you in advance.
  • I just did some test builds.
    VS2013 does appear to have a broken project file that is still including files that are now not used.
    1.8 has removed 3 files that were in 1.7's kernel directory: ovr_lockless.cpp, ovr_threadcommandqueue.cpp and ovr_threadcommandqueue.h. They did remove ovr_lockless.cpp from the project, but not the other two.

    VS2015 builds correctly. It doesn't try to use the missing files.

    I tried removing the missing files in VS2013, but too many other errors appeared.

    The easiest solution would be to move to VS2015. If that's not possible, you could try comparing the difference between the VS2013 and VS2015 project settings to see if something else hasn't been updated (maybe preprocessor defines or something).

2 Replies

  • I just did some test builds.
    VS2013 does appear to have a broken project file that is still including files that are now not used.
    1.8 has removed 3 files that were in 1.7's kernel directory: ovr_lockless.cpp, ovr_threadcommandqueue.cpp and ovr_threadcommandqueue.h. They did remove ovr_lockless.cpp from the project, but not the other two.

    VS2015 builds correctly. It doesn't try to use the missing files.

    I tried removing the missing files in VS2013, but too many other errors appeared.

    The easiest solution would be to move to VS2015. If that's not possible, you could try comparing the difference between the VS2013 and VS2015 project settings to see if something else hasn't been updated (maybe preprocessor defines or something).

  • Anonymous's avatar
    Anonymous
    Thank you kojack. I would try the both suggestions.