Skip to content

Commit fb5bc47

Browse files
committed
docs: Add build-errors.md
Since ImGui/cimgui keep breaking their APIs and introducing errors, add a document explaining it as the most common cause. Signed-off-by: Alexander Shishkin <[email protected]>
1 parent 9bc7748 commit fb5bc47

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ You contributions are welcome and appreciated! This document is here to help wit
77
- [But C?](#but-c)
88
- [Code layout](#code-layout)
99
- [More specifically](#more-specifically)
10+
- [I get build errors](#i-get-build-errors)
1011
- [Coding style](#coding-style)
1112
- [Pull requests](#pull-requests)
1213

@@ -67,6 +68,10 @@ A short tour of core/:
6768

6869
Another useful tool is git grep. Also, build configurations generate compile_commands.json that can be plugged into your favorite IDE. Having done that, you'll be able to inspect the code much more efficiently.
6970

71+
## I get build errors
72+
73+
If you're suddenly getting build errors, [check here](https://github.com/virtuoso/clap/tree/main/docs/build-errors.md). Otherwise, [report an issue](https://github.com/virtuoso/clap/issues/new) and/or send a pull request.
74+
7075
## Coding style
7176

7277
There's a .clang-format file at the top, unfortunately, as of this writing clang-format still isn't quite able to align pointers on the right the way that it's done in the code, so either fix up after it or just format the code by hand.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- [Run local web server](#run-local-web-server)
2121
- [Windows build](#windows-build)
2222
- [Build using cmake presets](#build-using-cmake-presets)
23+
- [Build errors](https://github.com/virtuoso/clap/tree/main/docs/build-errors.md)
2324
- [What to do with all this](#what-to-do-with-all-this)
2425

2526
## Live demos

docs/build-errors.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Build Errors
2+
3+
If after updating from the `main` branch you suddenly start getting build errors
4+
and Github runners built the same code successfully (which should always be the
5+
case), they are probably coming from ImGui API mismatch between your local copy
6+
and ImGui and/or cimgui upstream. They usually look something like this:
7+
```
8+
core/pipeline-debug.c:222:49: error: too few arguments to function call, expected 6, have 4
9+
221 | igImage((ImTextureID)texture_id(pass_tex), (ImVec2){512, 512 * aspect},
10+
| ~~~~~~~
11+
222 | (ImVec2){1,1}, (ImVec2){0,0});
12+
| ^
13+
```
14+
or
15+
```
16+
core/ui-imgui.c:23:26: error: use of undeclared identifier 'igGetIO_ContextPtr'
17+
23 | struct ImGuiIO *io = igGetIO_ContextPtr(ctx);
18+
| ^
19+
```
20+
21+
You may think that removing the local build directory is the solution, but actually
22+
you need to remove `deps/.bootstrap.json`:
23+
```sh
24+
rm deps/.bootstrap.json
25+
```
26+
27+
and configure again with `./configure.sh` or `cmake --preset=emtest` or suchlike. The
28+
build directory can stay.

0 commit comments

Comments
 (0)