Steam Compiler Warnings 4.17

We just updated to 4.17 and are getting a bunch of compiler warnings when using the steam api.

Here is one of the warnings, the others are similar:

C:\Users\nicho\Documents\Unreal Projects\UE_4.17\Engine\Source\ThirdParty\Steamworks\Steamv139\sdk\public\steam/steam_api.h(302): warning C4265: 'CCallResult<SteamGame,LobbyCreated_t>': class has virtual functions, but destructor is not virtual instances of this class may not be destructed correctly
C:\Users\nicho\Documents\Unreal Projects\Game\Source\Game\Steam/SteamGame.h(42): note: see reference to class template instantiation 'CCallResult<SteamGame,LobbyCreated_t>' being compiled

I have looked into the warning and from what I have read, it sounds like I have to make the destructor of ccallresult in steam_api virtual, but since we are not using a custom engine, we cannot change the file.

This isn’t preventing the game from compiling, but it would be nice to get rid of these warnings.

Any help is greatly appreciated.

Thanks,
Nick

Seeing the same issue, haven’t found a solution though :frowning:

For anyone running into this as well.

The solution is to open up

Engine\Source\ThirdParty\Steamworks\Steamv139\sdk\public\steam/steam_api.h

and add virtual to all the destructors (For example, change ~CCallResult() to virtual ~CCallResult()).

There are like 2 or 3 of them in that file. Once you do that, the errors will be gone! No need to have your own custom engine, just add that will fix it!

This may be a very late answer, but what you should do to ensure your code is compiling on all machines (unlike the previous answer) you should disable that certain warning from MSVC using #pragma warning(disable: 4265)
and enable it after you are done with that code path.

so heres your code (in theory):

#pragma once
#pragma warning(disable: 4265) // Here you disable the compiler throwing warning with code C4265.

#include "steam_api.h" // Make sure this points to the real steam api.h.
#include "GameFramework/Actor.h"
#include "YourFile.generated.h"

UCLASS().... //

// At the end of the header file:
#pragma warning(default: 4265) // Here we say treat the warning with code C4265 just as usual again.

These are just warnings and no errors, but since we compile with warnings as errors by default it fails to compile.
The pragma disable essentially tells the compiler to ignore these warnings.