I may be off a bit here but in order to set a value on a const, I believe you have to assign it in the header rather than the .cpp. So you should declare and give initial value at the same time in your .h file.
Additionally, it’s probably better to write 1.0f rather than 1.f… (the same applies to 0.f and 10.f of course
Hi, I am kind of newbie for C++. I actually come from JAVA world The thing I am trying to do is to create some static and constant variables. However, I could not. Actually I succeeded when I create MIN_VOLUME variable only but it failed when I added more. Can someone lead me what the real problem is and how to succeed?
Your syntax looks correct. Did you by any chance leave off the UCLASS declaration from ACloud? If so, then perhaps GENERATED_UCLASS_BODY() is bogus and may be interfering with the compile. This is just a guess.
EDIT: Try removing the statics. You will get a different error that should be more indicative of what went wrong. My guess is that ACloud is not properly declared.
It seems that UE4\Engine\Source\Runtime\Engine\Public\Audio.h defines a macro called MAX_VOLUME… it might be conflicting with that (given your syntax highlighter made it purple, I’m guessing it is).
Could you try adding #undef MAX_VOLUME above your class declaration to see if the issue goes away then.
Impressive! I began to think of the idea that there was a bug issue in the compiler. I am glad to hear that there is something concrete reason behind that. The main problem is that visual studio does not assist great.