golang-ui / nuklear

This project provides Go bindings for nuklear.h — a small ANSI C GUI library.

Home Page:https://github.com/vurtun/nuklear

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined reference to `__assert_func'

SaadHafiane opened this issue · comments

Hi,

when go building nk-example on Win10 64 bits using go 1.8.3, the following error log appears:

C:\Go\PATH\src\github.com\golang-ui\nuklear\cmd\nk-example>go build
# github.com/golang-ui/nuklear/cmd/nk-example
C:\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\Saad\AppData\Local\Temp\go-link-061616495\000001.o: In function `glfwSwapBuffers':
C:\Go\PATH\src\github.com\go-gl\glfw\v3.2\glfw/glfw/src/context.c:609: undefined reference to `__assert_func'
C:\Users\Saad\AppData\Local\Temp\go-link-061616495\000001.o: In function `glfwExtensionSupported':
C:\Go\PATH\src\github.com\go-gl\glfw\v3.2\glfw/glfw/src/context.c:642: undefined reference to `__assert_func'
C:\Users\Saad\AppData\Local\Temp\go-link-061616495\000001.o: In function `glfwGetProcAddress':
C:\Go\PATH\src\github.com\go-gl\glfw\v3.2\glfw/glfw/src/context.c:707: undefined reference to `__assert_func'
C:\Users\Saad\AppData\Local\Temp\go-link-061616495\000001.o: In function `glfwGetInputMode':
C:\Go\PATH\src\github.com\go-gl\glfw\v3.2\glfw/glfw/src/input.c:153: undefined reference to `__assert_func'
C:\Users\Saad\AppData\Local\Temp\go-link-061616495\000001.o: In function `glfwSetInputMode':
C:\Go\PATH\src\github.com\go-gl\glfw\v3.2\glfw/glfw/src/input.c:174: undefined reference to `__assert_func'
C:\Users\Saad\AppData\Local\Temp\go-link-061616495\000001.o:C:\Go\PATH\src\github.com\go-gl\glfw\v3.2\glfw/glfw/src/input.c:262: more undefined references to `__assert_func' follow
C:\Users\Saad\AppData\Local\Temp\go-link-061616495\000002.o: In function `_cgo_2daa1da745f8_C2func_calloc':
/c/Go/PATH/src/github.com/golang-ui/nuklear/nk/cgo-gcc-prolog:42: undefined reference to `__errno'
/c/Go/PATH/src/github.com/golang-ui/nuklear/nk/cgo-gcc-prolog:44: undefined reference to `__errno'
C:\Users\Saad\AppData\Local\Temp\go-link-061616495\000002.o: In function `nk_insert_window':
C:\Go\PATH\src\github.com\golang-ui\nuklear\nk/nuklear.h:18401: undefined reference to `__assert_func'
C:\Go\PATH\src\github.com\golang-ui\nuklear\nk/nuklear.h:18402: undefined reference to `__assert_func'
C:\Go\PATH\src\github.com\golang-ui\nuklear\nk/nuklear.h:18396: undefined reference to `__assert_func'
C:\Go\PATH\src\github.com\golang-ui\nuklear\nk/nuklear.h:18395: undefined reference to `__assert_func'
C:\Users\Saad\AppData\Local\Temp\go-link-061616495\000002.o: In function `nk_do_button':
C:\Go\PATH\src\github.com\golang-ui\nuklear\nk/nuklear.h:14036: undefined reference to `__assert_func'
C:\Users\Saad\AppData\Local\Temp\go-link-061616495\000002.o:C:\Go\PATH\src\github.com\golang-ui\nuklear\nk/nuklear.h:14038: more undefined references to `__assert_func' follow
collect2.exe: error: ld returned 1 exit status

System info:

go version go1.8.3 windows/amd64

>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-7.1.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev2, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
Thread model: posix
gcc version 7.1.0 (Rev2, Built by MSYS2 project)

Hi @SaadHafiane ! It seems that github.com/go-gl/glfw/v3.2/glfw package fails to build, try to run go get -u github.com/go-gl/glfw/v3.2/glfw in your console. If the error will be the same, it's better to create an issue in their tracker https://github.com/go-gl/glfw/issues

My configs:

  • 64-bit
$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\Program Files (x86)\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/Program\ Files\ (x86)/mingw-w64/i686-5.3.0-posix-dwarf-rt_v4-rev0/mingw32/bin/../libexec/gcc/i686-w64-mingw32/5.3.0/lto-wrapper.exe
Target: i686-w64-mingw32
Thread model: posix
gcc version 5.3.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project)
  • 32-bit
$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/5.3.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-5.3.0/configure --build=x86_64-pc-linux-gnu --host=m
ingw32 --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i58
6 --enable-languages=c,c++,objc,obj-c++,fortran,ada --enable-static --enable-sha
red --enable-threads=posix --with-dwarf2 --disable-sjlj-exceptions --enable-vers
ion-specific-runtime-libs --enable-libstdcxx-debug --with-tune=generic --enable-
libgomp --disable-libvtv --enable-nls
Thread model: posix
gcc version 5.3.0 (GCC)

Hi @xlab, thanks for your response. I am still getting the same error log. I looked around could be related to my Msys2 setup. Which Mingw64 installer are you using?

@SaadHafiane I have a link in the readme for 32-bit version https://github.com/golang-ui/nuklear#desktop-installation it appears to be MSYS 1.0

For 64-bit version I can't remember the source (it probably was official repo) but version is specific mingw-w64/i686-5.3.0-posix-dwarf-rt_v4-rev0

@xlab thanks. Looks like you used MinGW-W64 Online Installer.

I will test and provide feedback.

Update:

@xlab I am still getting the same error log. Do you mind if you share your PATH?

I have created a new issue at GLFW 202 as it seems to belated to the compilation on Windows 64bits with Mingw64.

One thing to notes is that you are using the i686 version of Mingw-W64 which is confusingly enough 32bits. You should install the X86_64 version

Sorry, forgot to mention, I got these from my virtual machine running 32-bit Windows 7,
I currently have no access to my 64-bit workstation with Windows 10.. I'll update when have a chance.

P.S. checked my $PATH, imo it will confuse things more for you.