Quellcode durchsuchen

Error in gdexample.cpp

When adding the getter and setter functions to the example project a void has been added to the constructor in line 439 which was previously not there (in line 213) and is also causing the error C2533: constructors not allowed a return type. Simply removing it again fixes it.
Yunusemre-Oeztuerk vor 2 Jahren
Ursprung
Commit
c6d224c4ea
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      tutorials/scripting/gdextension/gdextension_cpp_example.rst

+ 1 - 1
tutorials/scripting/gdextension/gdextension_cpp_example.rst

@@ -442,7 +442,7 @@ show the methods we end up changing, don't remove the lines we're omitting:
         ClassDB::add_property("GDExample", PropertyInfo(Variant::FLOAT, "amplitude"), "set_amplitude", "get_amplitude");
     }
 
-    void GDExample::GDExample() {
+    GDExample::GDExample() {
         // Initialize any variables here.
         time_passed = 0.0;
         amplitude = 10.0;