-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example code does not work? #91
Comments
The same happens to me. Build example:
Import go example:
Notes:
|
Getting this exact error as well from my own code just by having the inclusion. My go.mod looks like:
and my import looks like: import (
"log"
"os"
"regexp"
"runtime"
"strconv"
"strings"
"github.com/golang-ui/nuklear/nk"
"github.com/veandco/go-sdl2/sdl"
) Even Tried indirects as well, same result. |
SDL2 example doesn't work either. It seems like the functions are based on some older nuklear api version, the arguments provided in the examples doesn't match the current api. |
Probably I see the same error.
My environment is like this:
|
I guess c-for-go failed to treat enums correctly: // NkInputKey function as declared in nk/nuklear.h:837
func NkInputKey(arg0 *Context, arg1 C.enum_, down Bool) {
carg0, carg0AllocMap := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown
carg1, carg1AllocMap := (C.enum_)(arg1), cgoAllocsUnknown
cdown, cdownAllocMap := (C.nk_bool)(down), cgoAllocsUnknown
C.nk_input_key(carg0, carg1, cdown)
runtime.KeepAlive(cdownAllocMap)
runtime.KeepAlive(carg1AllocMap)
runtime.KeepAlive(carg0AllocMap)
} |
One of the necessary changes is diff --git a/nk.yml b/nk.yml
index 237576e..bebea9b 100644
--- a/nk.yml
+++ b/nk.yml
@@ -70,6 +70,7 @@ TRANSLATOR:
- {transform: export}
const:
- {action: accept, from: "(?i)^nk_"}
+ - {action: replace, from: "(?i)^nk_bool", to: "BoolType"}
- {action: replace, from: "(?i)^nk_", to: _}
- {action: ignore, from: _INT8}
- Even with the PR xlab/c-for-go#176 and the above patch, I have not succeeded to compile this yet:
|
Hey, i am getting this
was checking the
nk-example
.The text was updated successfully, but these errors were encountered: