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"

FVector4 error not usable with x32 game package

Today after try to compile my game as shipped for distribution using the Purpleprint 2 - Kit plugin, my plugin got functions for all types and one of that are the functions for FVector4, the problem:

Can compile fine for the editor without reports in VS and looks like compile too for x64 games, but no compile for x32 games: Error:

 MainFrameActions: Packaging (Windows (32-bit)): UnrealBuildTool: source\ppklibrary\core\PPKLibraryMath.h(119): error C2719: 'Vec4Value': formal parameter with requested alignment of 16 won't be aligned
 MainFrameActions: Packaging (Windows (32-bit)): UnrealBuildTool: source\ppklibrary\core\PPKLibraryMath.h(123): error C2719: 'Vec4Value': formal parameter with requested alignment of 16 won't be aligned
 MainFrameActions: Packaging (Windows (32-bit)): UnrealBuildTool: PPKLibrary.generated.cpp
 MainFrameActions: Packaging (Windows (32-bit)): UnrealBuildTool: source\ppklibrary\core\PPKLibraryMath.h(119): error C2719: 'Vec4Value': formal parameter with requested alignment of 16 won't be aligned
 MainFrameActions: Packaging (Windows (32-bit)): UnrealBuildTool: source\ppklibrary\core\PPKLibraryMath.h(123): error C2719: 'Vec4Value': formal parameter with requested alignment of 16 won't be aligned
 MainFrameActions: Packaging (Windows (32-bit)): UnrealBuildTool: Source\PPKLibrary\Core\PPKLibraryMath.cpp(143): error C2719: 'Vec4Value': formal parameter with requested alignment of 16 won't be aligned
 MainFrameActions: Packaging (Windows (32-bit)): UnrealBuildTool: Source\PPKLibrary\Core\PPKLibraryMath.cpp(152): error C2719: 'Vec4Value': formal parameter with requested alignment of 16 won't be aligned
 MainFrameActions: Packaging (Windows (32-bit)): UnrealBuildTool: source\ppklibrary\core\PPKLibraryTools.h(280): error C2719: 'Vec4Value': formal parameter with requested alignment of 16 won't be aligned
 MainFrameActions: Packaging (Windows (32-bit)): UnrealBuildTool: Source\PPKLibrary\Core/PPKLibraryMath.h(119): error C2719: 'Vec4Value': formal parameter with requested alignment of 16 won't be aligned
 MainFrameActions: Packaging (Windows (32-bit)): UnrealBuildTool:  Source\PPKLibrary\Core/PPKLibraryMath.h(123): error C2719: 'Vec4Value': formal parameter with requested alignment of 16 won't be aligned
 MainFrameActions: Packaging (Windows (32-bit)): UnrealBuildTool: Source\PPKLibrary\Core\PPKLibraryTools.cpp(764): error C2719: 'Vec4Value': formal parameter with requested alignment of 16 won't be aligned
 MainFrameActions: Packaging (Windows (32-bit)): UnrealBuildTool: Source\PPKLibrary\Core/PPKLibraryTools.h(280): error C2719: 'Vec4Value': formal parameter with requested alignment of 16 won't be aligned

Source Code of Plugin (With reference to one of the errors function):

 /** Returns the euler like FVector4 value */
 UFUNCTION( BlueprintCallable, meta = ( DisplayName = "Convert 180 To 360 Rotation" ), Category = "PP2KLibrary|Math|Vector4" )
     static FVector4 V4MakeFullFromHalfRot( const FVector4 Vec4Value );

https://github.com/Hevedy/PurpleprintKit/blob/master/Projects/UnrealEngine4/Purpleprint2Kit/Plugins/PurpleprintKitPlugin/Source/PPKLibrary/Core/PPKLibraryMath.h#L118

 FVector4 UPPKLibraryMath::V4MakeFullFromHalfRot( const FVector4 Vec4Value ) {
     FVector4 value;
     value.X = Vec4Value.X < 0.0f ? Vec4Value.X + 360.0f : Vec4Value.X;
     value.Y = Vec4Value.Y < 0.0f ? Vec4Value.Y + 360.0f : Vec4Value.Y;
     value.Z = Vec4Value.Z < 0.0f ? Vec4Value.Z + 360.0f : Vec4Value.Z;
     value.W = Vec4Value.W < 0.0f ? Vec4Value.W + 360.0f : Vec4Value.W;
     return value;
 }

https://github.com/Hevedy/PurpleprintKit/blob/master/Projects/UnrealEngine4/Purpleprint2Kit/Plugins/PurpleprintKitPlugin/Source/PPKLibrary/Core/PPKLibraryMath.cpp#L143

Product Version: UE 4.10
Tags:
more ▼

asked Jan 19 '16 at 02:18 PM in Bug Reports

avatar image

Hevedy
628 55 75 110

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

FVector4 should be passed by reference as a function argument on 32-bit platforms. Passing by value will cause this compilation error. This is not a bug.

Also, you are declaring your by-value function parameters as 'const', which doesn't make much sense and will most likely confuse people. (However, when you change them to be by-reference, 'const' will be a good idea).

more ▼

answered Jan 19 '16 at 02:39 PM

avatar image

cancel
2.3k 100 70 120

avatar image Hevedy Jan 19 '16 at 03:22 PM

Why then don't happen with the Vector or Vector2D or others ?

avatar image cancel Jan 19 '16 at 03:41 PM

FVector4 is larger and doesn't fit on a register in 32-bit.

avatar image Hevedy Jan 19 '16 at 03:54 PM

Okay thanks you.

(comments are locked)
10|2000 characters needed characters left
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