Skip to content

Commit 018a434

Browse files
authored
LLVM/bindgen info in setup and FAQ (#62)
Moved from godot-rust ReadMe
1 parent efe63b2 commit 018a434

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

src/faq/configuration.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Please note: you only need to include paths for the targets you plan on building
2222

2323
```toml
2424
[entry]
25-
X11.64="res://path/to/lib{name_of_binary}.so"
26-
OSX.64="res://path/to/lib{name_of_binary}.dylib"
27-
Windows.64="res://path/to/{name_of_binary}.dll"
25+
X11.64="res://path/to/lib{binary-name}.so"
26+
OSX.64="res://path/to/lib{binary-name}.dylib"
27+
Windows.64="res://path/to/{binary-name}.dll"
2828

2929
[dependencies]
3030
X11.64=[ ]
@@ -48,15 +48,26 @@ Script files can be created in two ways.
4848
```toml
4949
[gd_resource type="NativeScript" load_steps=2 format=2]
5050

51-
[ext_resource path="res://path/to/{name of file}.gdnlib" type="GDNativeLibrary" id=1]
51+
[ext_resource path="res://path/to/{filename}.gdnlib" type="GDNativeLibrary" id=1]
5252

5353
[resource]
54-
resource_name = "{class name}"
55-
class_name = "{class name}"
54+
resource_name = "{class-name}"
55+
class_name = "{class-name}"
5656
library = ExtResource( 1 )
5757
```
5858

5959

60+
## C headers not found by bindgen
61+
62+
When building the library, `bindgen` may produce errors that look like this:
63+
64+
```
65+
godot-rust/gdnative-sys/godot_headers/gdnative/string.h:39:10: fatal error: 'wchar.h' file not found
66+
```
67+
68+
This means that `bindgen` was unable to find the C system headers for your platform. If you can locate the headers manually, you may try setting the `C_INCLUDE_PATH` environment variable so `libclang` could find them. If on Windows, you may try building from the Visual Studio "developer console", which should setup the appropriate variables for you.
69+
70+
6071
## Why aren't my scripts showing up in the _Add Node_ portion of the editor, even though they inherit from `Node`, `Node2D`, `Spatial` or `Control`?
6172

6273
Due to limitations with Godot 3.x's version of GDNative, NativeScript types do not get registered in the class database. As such, these classes are not included in the _Create New Node_ dialog.

src/getting-started/setup.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ After installation, check that LLVM was installed properly:
4242
clang -v
4343
```
4444

45+
`bindgen` may complain about a missing `llvm-config` binary, but it is not actually required to build the `gdnative` crate. If you see a warning about `llvm-config` and a failed build, it's likely that you're having a different problem!
46+
47+
4548
## Using the template
4649

4750
We also provide an experimental [template](https://github.com/godot-rust/godot-rust-template) to get you started right away. All the boilerplate stuff is already done for you. If you have decided to use the template, you can skip section 2.2. Check out the [wiki](https://github.com/godot-rust/godot-rust-template/wiki) for instructions.

0 commit comments

Comments
 (0)