Skip to content
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

[bug] - Cant run/build basic window #911

Closed
cltWilly opened this issue Nov 13, 2024 · 4 comments
Closed

[bug] - Cant run/build basic window #911

cltWilly opened this issue Nov 13, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@cltWilly
Copy link

What happend?

I want simply run the exmaple code for hello world window, but i am keep getting error when trying to build or run the main.go
Error Screenshot

Any another project without giu works fine.
I was trying different mingw versions, but nothing seems to work. So i tried TDM-GCC but is the same. There is gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/TDM-GCC-64/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-git-10.3.0/configure --build=x86_64-w64-mingw32 --enable-targets=all --enable-languages=ada,c,c++,fortran,jit,lto,objc,obj-c++ --enable-libgomp --enable-lto --enable-graphite --enable-cxx-flags=-DWINPTHREAD_STATIC --disable-build-with-cxx --disable-build-poststage1-with-cxx --enable-libstdcxx-debug --enable-threads=posix --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --disable-libstdcxx-pch --enable-libstdcxx-threads --enable-libstdcxx-time=yes --enable-mingw-wildcard --with-gnu-ld --disable-werror --enable-nls --disable-win32-registry --enable-large-address-aware --disable-rpath --disable-symvers --prefix=/mingw64tdm --with-local-prefix=/mingw64tdm --with-pkgversion=tdm64-1 --with-bugurl=https://github.com/jmeubank/tdm-gcc/issues
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.3.0 (tdm64-1)

Code example

main.go
package main

import (
	"fmt"

	g "github.com/AllenDang/giu"
)

func onClickMe() {
	fmt.Println("Hello world!")
}

func onImSoCute() {
	fmt.Println("Im sooooooo cute!!")
}

func loop() {
	g.SingleWindow().Layout(
		g.Label("Hello world from giu"),
		g.Row(
			g.Button("Click Me").OnClick(onClickMe),
			g.Button("I'm so cute").OnClick(onImSoCute),
		),
	)
}

func main() {
	wnd := g.NewMasterWindow("Hello world", 400, 200, g.MasterWindowFlagsNotResizable)
	wnd.Run(loop)
}

To Reproduce

  1. copy the window example as in docs
  2. run go run main.go or go build main

Version

master

OS

windows 10

@cltWilly cltWilly added the bug Something isn't working label Nov 13, 2024
@gucio321
Copy link
Collaborator

@cltWilly this might be related with gcc version. Could you try to compile using mingw (as the shared library was compiled using it).

@gucio321
Copy link
Collaborator

gucio321 commented Nov 13, 2024

yes, this deffinitly might be the problem. You'r using gcc v10 and cimgui.a was compiled (according to its content) with GCC: (Rev1, Built by MSYS2 project) 14.2.0

Edit: we need to stop recommending tdm-gcc in our readme as it seems to be discontinued (last update in 2020)

@cltWilly
Copy link
Author

ok i changed it to mingw64. and after like 5 minutes it finally build it :D. And I have a good workstation. So it works now thank you.

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/14.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-14.2.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/buildroot/x86_64-1420-mcf-seh-ucrt-rt_v12-rev0/mingw64 --enable-host-shared --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=mcf --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --enable-libstdcxx-filesystem-ts=yes --disable-libssp --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/buildroot/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/buildroot/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/buildroot/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/buildroot/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-mcf-seh-rev0, Built by MinGW-Builds project' --with-bugurl=https://github.com/niXman/mingw-builds LD_FOR_TARGET=/c/buildroot/x86_64-1420-mcf-seh-ucrt-rt_v12-rev0/mingw64/bin/ld.exe --with-boot-ldflags='-pipe -fno-ident -L/c/buildroot/x86_64-1420-mcf-seh-ucrt-rt_v12-rev0/mingw64/opt/lib -L/c/buildroot/prerequisites/x86_64-zlib-static/lib -L/c/buildroot/prerequisites/x86_64-w64-mingw32-static/lib  -Wl,--disable-dynamicbase -static-libstdc++ -static-libgcc'
Thread model: mcf
Supported LTO compression algorithms: zlib
gcc version 14.2.0 (x86_64-mcf-seh-rev0, Built by MinGW-Builds project)

@gucio321
Copy link
Collaborator

gucio321 commented Nov 13, 2024

ok i changed it to mingw64. and after like 5 minutes it finally build it :D. And I have a good workstation. So it works now thank you.

yeah, build time is unfortunately a bit painful...
This is mainly due to CGO not being parallelized enough. There was some progress on that issue recently iirc so maybe 1.24 will be a bit better.

Let me close this.

gucio321 added a commit to gucio321/giu that referenced this issue Nov 13, 2024
TDM-GCC is https://github.com/jmeubank/tdm-gcc.
The current version of gcc provided by the project is 10.3.0.
According to jmeubank/tdm-gcc#68
I think the project was discontinued.

According to AllenDang#911
we are forced to stop recommending tdm-gcc for giu.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants