Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How can I get Visual Studio 2017 to compile UE4.19 and Steamworks 1.39?

Hi all,

I am struggling to get Visual Studio 2017 to successfully compile a newly created Blueprint Function Library.

As soon as I add the include to the steam api header file and try to compile it moans about ARRAY_COUNT macro redefinition, strncpy warnings and various other syntax errors in the gen.cpp.

I have searched around various tutorials (Unreal Docs, Rama, Epic Wiki etc) and done the following:

  1. Used the Unreal Docs to add the relevant sections to the DefaultEngine.ini to configure the OnlineSystemSteam.

  2. Enabled the OnlineSubsystemSteam plugin in the game project.

  3. Added bUsesSteam=true; to the target.cs

  4. Uncommented the PrivateDependencyModuleNames.Add("OnlineSubsystem"); in the build.cs

  5. Added PublicDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "OnlineSubsystemUtils" }); to the build.cs

  6. Added DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam"); to the build.cs

My versions are:
Unreal Engine 4.19
Steamworks 1.39 (Came preinstalled with UE4.19)
Visual Studio 2017 (Vanilla version)

I know how to program code and blueprints but am somewhat new to C++ so I do not understand what the ARRAY_COUNT macro is/does. I'm usually able to diagnose problems like this but this one has me confused.

The most confusing thing for me is that the information on the net is relevant to several different versions of Unreal and some say to do this and some say to do that. I was hoping that enabling the OnlineSubsystemSteam plugin would have enabled me to do everything that the Steamworks SDK allows using Blueprints but that is not the case.

Any help on this would be appreciated.

Thanks in advance.

Product Version: UE 4.19
more ▼

asked Jul 26 '18 at 02:01 PM in C++ Programming

avatar image

96 2 6 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

When I reached out to Unreal about this issue they responded with Valves response which is this macro around the includes of steamwork files in the header.

 #pragma push_macro("ARRAY_COUNT")
 #include "ThirdParty/Steamworks/Steamv139/sdk/public/steam/steam_api.h"
 #include "ThirdParty/Steamworks/Steamv139/sdk/public/steam/isteamuser.h"
 #pragma pop_macro("ARRAY_COUNT")

Hope this helps!

more ▼

answered Oct 07 '18 at 02:31 AM

avatar image


(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question