godotengine / godot-headers

Headers for the Godot API supplied by the GDNative module.
MIT License
381 stars 91 forks source link

Update README.md example to comply with latest API #71

Closed wg-romank closed 3 years ago

wg-romank commented 4 years ago

I tried to compile example from README, but hit

➜  SimpleLibrary make build
g++ -g -fPIC -std=c99 -c src/test.c -I../godot_headers -o src/test.os
cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not for C++
src/test.c: In function ‘godot_variant some_test_procedure(void*, godot_array*)’:
src/test.c:71:9: error: ‘godot_string_new_unicode_data’ was not declared in this scope; did you mean ‘godot_string_name_new_data’?
   71 |         godot_string_new_unicode_data(&s, L"Hello World", 11);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         godot_string_name_new_data
make: *** [Makefile:2: build] Error 1

seems like function name was changed in gdnative/string.h

vnen commented 3 years ago

Thanks! And sorry for the delay.