I’m getting an error that I’m unsure how to solve. Luckily my issue should be very easy to replicate for anyone willing to help. Here are the steps I take…
-I have downloaded and installed UE4 with the latest version.
-I start a new project (C++ based w/ basic code and starter content)
- I name the project ‘MyProject’
Once the new project loads…
- I click File>New C++ class
- I choose the option to show all classes
- I choose the class type ‘SynthComponent’
- I name the new component ‘MySynthComponent’ and click to create the new C++ class
Unreal Editor then tries to create the new C++ component. Here is where I get a compiler error.
A notification window shows up that says:
"Successfully added class ‘MySynthComponent’, however you must recompile the 'MyProject module before it will appear in the content browser. Failed to automatically hot reload the ‘MyProject’ module.
There is a red warning in the log:
“request failed. libcurl error 6: (Couldn’t resolve host name)”
Then there are some errors to follow:
“ERROR: UBT ERROR: Failed to produce item: MyProject\Binaries\Win64\UE4Editor-MyProject-502.dll”
Ignoring these errors, I tried clicking the ‘Compile’ button at the top of the editor. Compilation fails again, and the output points me to an apparent error in the SynthComponent template class:
" error C2555: ‘UMySynthComponent::OnGenerateAudio’:overriding virtual function return type differs and is not covariant from ‘USynthComponent::On GenerateAudio’ "
I don’t really understand what the error means, but it seems to have to do with the MySynthComponent class I have created. In side that newly created class, the ‘OnGenerateAudio’ function is declared as having a void return type, but the return type of the function it inherits from is int32.
Seeing as I’m only trying to use a built in engine template (the USynthComponent type), I’m not sure if I’m doing something wrong or have found a bug? Either way I’m pretty lost; am no programming expert, and am switching over to Unreal from Unity, so I’m unsure what I’m dealing with on more or less every level here!
Any help in simply setting up a new Synth Component type without these compiler errors will be greatly appreciated. The Synth Component is supposed to generate a simple sound tone by generating a sine wave buffer in the C++ by the way.
Thanks!