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"

Unrecognized type 'void' in FORCEINLINE fucntion

I have a function:

     UFUNCTION(BlueprintCallable, Category = "Resources", meta = (CompactNodeTitle = "SET"))
         static FORCEINLINE void Set(FResources r, EResource resource, float value)
     {
         r.Set(resource, value);
     }

The compiler refuses to compile this function for some reason stating: Unrecognized type 'void' - type must be a UCLASS, USTRUCT or UENUM

If I change void to something like int32 and add "return 0;" to the end of the function it works, but for some reason it won't compile as long as the return type is void. What the hell is going on?

EDIT: Forgot to mention that this error only occurs if the function is FORCEINLINE

Product Version: UE 4.12
Tags:
more ▼

asked Aug 28 '16 at 03:41 PM in C++ Programming

avatar image

DELTA_12
101 8 13 20

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

2 answers: sort voted first

// this compiles for me , Engine version 4.14 but only recently stepped version up so should no be an issue for 4.12 FORCEINLINE UFUNCTION(BlueprintCallable, Category = "Something|WasHere")
void Set_Root_Component(USceneComponent* newRoot) { ActorRootComponent = newRoot; }

more ▼

answered Jan 06 '17 at 05:38 AM

avatar image

Jimbooti
21

avatar image DELTA_12 Jan 06 '17 at 11:43 AM

I've alreadly solved this a long time ago, but didn't updated the question, let me do that now

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

tl;dr

FORCEINLINE should be placed before UFUNCTION

more ▼

answered Apr 16 '18 at 03:36 PM

avatar image

Arty-McLabin
522 11 12 27

(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