Can't declare variables as UPROPERTY

For some reason I can’t declare variables as UPROPERTY in class that I want to be able to access from a Blueprint. Compilation will fail with the error “Missing ; in variable declaration” right after the variable definition in the header file. I don’t know why this would be the case, as I copied the UPROPERTY specifier from a character class which compiles fine with the same specifier. Here is the partial header file:

#pragma once

#include "GameFramework/Actor.h"
#include "GeneratedMeshComponent.h"
// #include "RandomTerrain.h"
#include "GameGeneratedActor.generated.h"

/**
 * 
 */
UCLASS()
class MYPROJECT_API AGameGeneratedActor : public AActor
{
	GENERATED_UCLASS_BODY()
	
	// uncommenting the UPROPERTY cause a compiler error "missing ; in variable declaration" 
	// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = TerrainGeneration)
		int32 NumTilesXY = 63;

	// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = TerrainGeneration)
		float TileSize = 100.f;

	// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = TerrainGeneration)
		int32 NumHills = 10;

	// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = TerrainGeneration)
		int32 NumValleys = 10;

Have you tried VisibleAnywhere or EditDefaultsOnly in place of EditAnywhere?

Sounds like UHT can’t properly handle C++11 feature for non-static class member initialization. Try initializing them in your constructor instead.

This seemed to do the trick, I’d probalby move the defaults to be set in Blueprint class as that is the purpose … exposing the parameters at run time and also avoidng a recompile everytime they change … also if I set the values in the constructo (I think) it would override the Blueprint values since the Blueprint constructor would get executed first.

Values set in constructor are used as defaults in Blueprint derived from this class. So feel free to set values within your constructor.