golang-ui / nuklear

This project provides Go bindings for nuklear.h — a small ANSI C GUI library.
https://github.com/vurtun/nuklear
MIT License
1.57k stars 98 forks source link

Doesn't work or install on windwos #12

Closed Fruchtgummi closed 7 years ago

Fruchtgummi commented 7 years ago

Hi,

follows errors on build

# github.com/golang-ui/nuklear/nk
In file included from src\github.com\golang-ui\nuklear\nk\cgo_helpers.go:11:0:
./nuklear_glfw_gl2.h:16:24: fatal error: GLFW/glfw3.h: No such file or directory
compilation terminated.

C:\goworkspace>go get -x github.com/golang-ui/nuklear/nk
WORK=C:\Users\Marc\AppData\Local\Temp\go-build622038790
mkdir -p $WORK\github.com\golang-ui\nuklear\nk\_obj\
mkdir -p $WORK\github.com\golang-ui\nuklear\
cd c:\goworkspace\src\github.com\golang-ui\nuklear\nk
CGO_LDFLAGS="-g" "-O2" "-lglfw3" "-lopengl32" "-lgdi32" "-lm" "-Wl,--allow-multiple-definition" "C:\\Go\\pkg\\tool\\windows_amd64\\cgo.exe" -objdir "C:\\Users\\Marc\\AppData\\Local\\Temp\\go-build622038790\\github.com\\golang-ui\\nuklear\\nk\\_obj\\" -importpath github.com/golang-ui/nuklear/nk -- -I "C:\\Users\\Marc\\AppData\\Local\\Temp\\go-build622038790\\github.com\\golang-ui\\nuklear\\nk\\_obj\\" -g -O2 -DNK_INCLUDE_FIXED_TYPES -DNK_INCLUDE_STANDARD_IO -DNK_INCLUDE_DEFAULT_ALLOCATOR -DNK_INCLUDE_FONT_BAKING -DNK_INCLUDE_DEFAULT_FONT -Wno-implicit-function-declaration -DNK_INCLUDE_FIXED_TYPES -DNK_INCLUDE_STANDARD_IO -DNK_INCLUDE_DEFAULT_ALLOCATOR -DNK_INCLUDE_FONT_BAKING -DNK_INCLUDE_DEFAULT_FONT -Wno-implicit-function-declaration -DNK_INCLUDE_FIXED_TYPES -DNK_INCLUDE_STANDARD_IO -DNK_INCLUDE_DEFAULT_ALLOCATOR -DNK_INCLUDE_FONT_BAKING -DNK_INCLUDE_DEFAULT_FONT -DNK_INCLUDE_VERTEX_BUFFER_OUTPUT -D_GLFW_WIN32 -DNK_INCLUDE_FIXED_TYPES -DNK_INCLUDE_STANDARD_IO -DNK_INCLUDE_DEFAULT_ALLOCATOR -DNK_INCLUDE_FONT_BAKING -DNK_INCLUDE_DEFAULT_FONT -Wno-implicit-function-declaration -DNK_INCLUDE_FIXED_TYPES -DNK_INCLUDE_STANDARD_IO -DNK_INCLUDE_DEFAULT_ALLOCATOR -DNK_INCLUDE_FONT_BAKING -DNK_INCLUDE_DEFAULT_FONT -Wno-implicit-function-declaration cgo_helpers.go color.go const.go font.go impl_glfw.go nk.go types.go
# github.com/golang-ui/nuklear/nk
In file included from src\github.com\golang-ui\nuklear\nk\cgo_helpers.go:11:0:
./nuklear_glfw_gl2.h:16:24: fatal error: GLFW/glfw3.h: No such file or directory
compilation terminated.

MinGW-W64 is installed

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/mingw-w64/x86_64-5.3.0-posix-seh-rt_v4-rev0/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/5.3.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-5.3.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw530/x86_64-530-posix-seh-rt_v4-rev0/mingw64 --with-gxx-include-dir=/mingw64/x86_64-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-isl-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw530/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw530/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw530/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw530/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-posix-seh-rev0, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw530/x86_64-530-posix-seh-rt_v4-rev0/mingw64/opt/include -I/c/mingw530/prerequisites/x86_64-zlib-static/include -I/c/mingw530/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw530/x86_64-530-posix-seh-rt_v4-rev0/mingw64/opt/include -I/c/mingw530/prerequisites/x86_64-zlib-static/include -I/c/mingw530/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw530/x86_64-530-posix-seh-rt_v4-rev0/mingw64/opt/lib -L/c/mingw530/prerequisites/x86_64-zlib-static/lib -L/c/mingw530/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: posix
gcc version 5.3.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)

On built with LiteIDE

go build github.com/go-gl/glfw/v3.2/glfw: c:\go\pkg\tool\windows_amd64\cgo.exe: exit status 2
go build github.com/go-gl/gl/v3.2-core/gl: c:\go\pkg\tool\windows_amd64\cgo.exe: exit status 2
go build github.com/golang-ui/nuklear/nk: c:\go\pkg\tool\windows_amd64\cgo.exe: exit status 2
Fehler: Prozess beendet mit Rückgabewert 1.

On c:\go\pkg\tool\windows_amd64\cgo.exe: is nothing this cgo.exe

Whats the problem?

xlab commented 7 years ago

@Fruchtgummi

You're using some very old version of the repo, there is no nuklear_glfw_gl2.h and any references to it in the master branch. I implemented drawing backends in pure Go back in early January 2017 ;)

Try to go-get update it.

go get -u github.com/golang-ui/nuklear/nk
Fruchtgummi commented 7 years ago

Indeed!

Yes, now I have the following error! :)

# nuke
c:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 3221225781

Fehler: Prozess beendet mit Rückgabewert 2.
xlab commented 7 years ago

@Fruchtgummi Awesome!

By the way, this is very specific error, can I see the source of nuke? That's not one of my examples, could you firstly check with https://github.com/golang-ui/nuklear/tree/master/cmd/nk-example please? So we can be sure

go get github.com/golang-ui/nuklear/cmd/nk-example
Fruchtgummi commented 7 years ago

Yes, it is your example!

Here a error from LiteIDE and the process of build.

# github.com/golang-ui/nuklear/cmd/nk-example
c:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 3221225781

Fehler: Prozess beendet mit Rückgabewert 2.

after "get force rebuilding" and "get update network"

go build github.com/go-gl/glfw/v3.2/glfw: c:\go\pkg\tool\windows_amd64\cgo.exe: exit status 2
go build github.com/go-gl/gl/v3.2-core/gl: c:\go\pkg\tool\windows_amd64\cgo.exe: exit status 2
Fehler: Prozess beendet mit Rückgabewert 1.

after force build

go build runtime/cgo: c:\go\pkg\tool\windows_amd64\cgo.exe: exit status 2
Fehler: Prozess beendet mit Rückgabewert 1.

I need C-Compiler?

I have installed

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/mingw-w64/x86_64-5.3.0-posix-seh-rt_v4-rev0/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/5.3.0/lto-wrapper.exe
Target: x86_64-w64-mingw32

....

Thread model: posix
gcc version 5.3.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)

German: "Fehler: Prozess beendet mit Rückgabewert 1." is English: "Error: Process terminated with return value 1."

xlab commented 7 years ago

@Fruchtgummi it seems you have wrong/broken MinGW environment, I'm not sure what's wrong with it, but I never got these issues under Win7/10 both 32/64 bits.

Also you certainly should be able to build

go build github.com/go-gl/glfw/v3.2/glfw
go build github.com/go-gl/gl/v3.2-core/gl

so it seems that the environment is broken, no the nuklear package itself.

Try to use MSYS (see https://github.com/golang-ui/nuklear#desktop-installation)

P.S. also found this https://sourceforge.net/p/mingw-w64/mailman/message/31834115/

Fruchtgummi commented 7 years ago

It's Running! Thx