Jelajahi Sumber

Fix gcc compilation flags for GDNative with C example

`-rdynamic` flag is needed to properly export the symbols (otherwise Godot may not find them).

Also changed to use the more common `.o` extension for objects on Linux.
George Marques 5 tahun lalu
induk
melakukan
c7bc8c7bcd
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      tutorials/plugins/gdnative/gdnative-c-example.rst

+ 2 - 2
tutorials/plugins/gdnative/gdnative-c-example.rst

@@ -361,8 +361,8 @@ On Linux:
 
 .. code-block:: none
 
-    gcc -std=c11 -fPIC -c -I../../godot_headers simple.c -o simple.os
-    gcc -shared simple.os -o ../bin/libsimple.so
+    gcc -std=c11 -fPIC -c -I../../godot_headers simple.c -o simple.o
+    gcc -rdynamic -shared simple.o -o ../bin/libsimple.so
 
 On macOS: