x

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"

Error while using steam_api.h on Linux/OSX

Hey,

Whenever i try to include the steam_api.h on Linux(or OSX) i get this error that:

ARRAY_COUNT is already defined in UnrealTemplate.h

Any workaround or fix for this issue?I Need to use the steam_api header file to use SteamTypes.

Thanks!

Product Version: UE 4.13 Preview
Tags:
more ▼

asked Aug 22 '16 at 10:51 AM in C++ Programming

avatar image

iSpakkio
200 9 10 20

avatar image TX_Alpha Aug 30 '16 at 02:24 PM

Do you have

 #pragma once

above your #includes?

avatar image iSpakkio Aug 31 '16 at 11:51 AM

Yes i do, do you think removing it would fix the issue?

(ATM i have no Linux installation on my PC)

avatar image TX_Alpha Aug 31 '16 at 01:50 PM

Definitely do NOT remove it.

I've done no work on Unix platforms, so I've got no other advice at the moment, but am interested in a response myself.

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

1 answer: sort voted first

Here's a workaround : NOTE : you will need the full engine source code

1 - go into \Engine\Source\Programs\UnrealBuildTool and then Linux/LinuxToolChain.cs

in line 303 remove the flag -Werror (this will not treat warnings as errors)

2 - for OSX go into the Mac folder and then MacToolChain.cs

line 123 do the same thing (remove -Werror flag)

now instead of an error i get a warning which should at least make the code compile warning:

 steamtypes.h(98,9): warning : 'ARRAY_COUNT' macro redefined [-Wmacro-redefined]
 3>  #define ARRAY_COUNT(COUNTER) CLANG_ATTR( "array_count:" #COUNTER ";" )
 3>          ^
 3>  Runtime/Core/Public/Templates\UnrealTemplate.h(98,9) :  note: previous definition is here
 3>  #define ARRAY_COUNT( array ) (sizeof(ArrayCountHelper(array))+0)
more ▼

answered Sep 04 '16 at 08:04 AM

avatar image

iSpakkio
200 9 10 20

avatar image VSZ Mar 29 '17 at 03:25 PM

Thanks a lot for sharing this. Not sure how many hours I would have spent tracking this down, you've really saved me some time :)

(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