Closed Challanger524 closed 4 months ago
Is it possible to resolve conflict through -ldflags
for conflicting package?
Helped adding -extldflags=-Wl,-allow-multiple-definition
full: go build -v -x -gcflags='all=-N -l' -ldflags='-extldflags=-Wl,-static,-allow-multiple-definition' ./cmd/bplan/
How much threat does this posses to the giu universe?🤭
no, you absolutely cant use cimgui-go and imgui-go in one place. whats more, if youre using cimgui along with giu, you should use the same version of cimgui-go. This is because you shouldn't use two separated imgui versions at once.
to solve your problem:
ok I've just read your comment, its useful sometimes :smile:
So, my answer is similar: You should not put imgui-go and cimgui-go in the same project as it might lead to some unexpected behaviours. Its because imgui-go uses different Dear ImGui version.
If you don't want to migrate your project ot cimgui-go (this shouldn't be hard to do) you could theoritically fork this repo and generate it for older Dear ImGui (this from imgui-go). This should work
I mean example might be faulty because cimgui-go
explicit example dependency is conflicting with imgui-go
from giu
.
Now I get it! Your hidden comment is the most valuable one :)
check if your giu uses cimgui-go (ensure you're using giu's master and not v0.7)
exactly!
go get https://github.com/AllenDang/giu
loaded v0.7 that depends on imgui-go
while master is migrated to cimgui-go
with it's examples.
Thank You @gucio321! Did not expected such a surprise from go get
that it gives higher priority to tag <version>
rather then master
branch, which is always on top on GitHub.
How to Upgrade and Downgrade Dependencies
go get foo updates to the latest version of foo. go get foo is equivalent to go get foo@latest — in other words, @latest is the default if no @ version is specified. \ In this section,
“latest” is the latest version with a
semver
tag
, or the latest known commit if there are no semver tags. Prerelease tags are not selected as “latest” unless there are no other semver tags on the repository (details).
☝️
nope, master giu
branch throws exception on clean (almost empty) main.go file
Probably @master
is not yet ready for release
Exception has occurred: fatal error
Error getting throw reason: could not find symbol value for s
Stack:
0 0x00007ff623ea6e24 in runtime.winthrow
at C:/Program Files/Go/src/runtime/signal_windows.go:349
1 0x00007ff623ea6e07 in runtime.lastcontinuehandler
at C:/Program Files/Go/src/runtime/signal_windows.go:342
2 0x00007ff623ea69f3 in runtime.sigtrampgo
at C:/Program Files/Go/src/runtime/signal_windows.go:177
3 0x00007ff6241555b0 in ???
at ?:-1
error: Only part of a ReadProcessMemory or WriteProcessMemory request was completed.
(truncated)
main.go
package main
import (
"fmt"
"github.com/AllenDang/giu"
)
func main() {
fmt.Println("Hello World! by: giu")
wnd = giu.NewMasterWindow("ImGui widgets demo", 800, 600, 0)
wnd.Run(loop)
}
func loop() {
fmt.Print("+")
}
go.mod
module giu.master
go 1.22.0
require github.com/AllenDang/giu v0.7.1-0.20240214102145-b906c79ac41f
require (
github.com/AllenDang/cimgui-go v0.0.0-20231219093052-24bd5dc22643 // indirect
github.com/AllenDang/go-findfont v0.0.0-20200702051237-9f180485aeb8 // indirect
github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3 // indirect
github.com/mazznoer/csscolorparser v0.1.3 // indirect
github.com/napsy/go-css v0.0.0-20221107082635-4ed403047a64 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/sahilm/fuzzy v0.1.0 // indirect
golang.design/x/hotkey v0.4.1 // indirect
golang.design/x/mainthread v0.3.0 // indirect
golang.org/x/image v0.15.0 // indirect
golang.org/x/sys v0.5.0 // indirect
gopkg.in/eapache/queue.v1 v1.1.0 // indirect
)
thats the problem.. your code works for me... Could you try to debug it somehow?
your code works for me...
on Windows 10?
On fedora linux
Before major version release it going to be tested on shWindows anyway (yes?), so if this is a case - we are prepared mentally. Or I just boiled it in the wrong way 🤷 somehow.
Not in a hurry for the solution, was playing with golang and imgui binding. Now I'm ready to go back to good old c++ with native imgui 😮💨
well, you can always use working version with imgui-go. In case of cimgui-go and windows: well I'm the only periodically active developer here right now. Whats more Im not really familiar with windows - my native dev-env is linux. I heard that cimgui sometimes crashes on windows but I can't debug this unfortunately. As long as there is no one to help, I don't know what can I do :cry:
also, here is an issue for this: https://github.com/AllenDang/giu/issues/735
What happend?
Fail to build
giu/imguidemo.go
, even aftergo clean -cache
Code example
```golang package main import ( сimgui "github.com/AllenDang/cimgui-go" g "github.com/AllenDang/giu" ) func main() { wnd := g.NewMasterWindow("ImGui widgets demo", 640, 480, 0) wnd.Run(loop) } func loop() { сimgui.ShowDemoWindow() } ```main.go
``` module bplan go 1.22.0 require ( github.com/AllenDang/cimgui-go v0.0.0-20240214101732-0ab265480437 github.com/AllenDang/giu v0.7.0 ) require ( github.com/AllenDang/go-findfont v0.0.0-20200702051237-9f180485aeb8 // indirect github.com/AllenDang/imgui-go v1.12.1-0.20221124025851-59b862ca5a0c // indirect github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3 // indirect github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 // indirect github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b // indirect github.com/mazznoer/csscolorparser v0.1.3 // indirect github.com/napsy/go-css v0.0.0-20221107082635-4ed403047a64 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/sahilm/fuzzy v0.1.0 // indirect golang.org/x/image v0.12.0 // indirect golang.org/x/sys v0.5.0 // indirect gopkg.in/eapache/queue.v1 v1.1.0 // indirect ) ```go.mod
``` ... C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/Daniil/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240214101732-0ab265480437/lib/windows/x64\cimgui.a(imgui_widgets.cpp.obj):imgui_widgets.:(.text+0x28cf0): multiple definition of `ImGui::SliderInt2(char const*, int*, int, int, char const*, int)'; C:\Users\Daniil\AppData\Local\Temp\go-link-4229020252\000089.o:C:/Users/Daniil/go/pkg/mod/github.com/!allen!dang/imgui-go@v1.12.1-0.20221124025851-59b862ca5a0c/imgui_widgets.cpp:3024: first defined here ... C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/Daniil/go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20240214101732-0ab265480437/lib/windows/x64\cimgui.a(implot_items.cpp.obj):implot_items.c:(.rdata+0xcb0): multiple definition of `ImPlot::MaxIdxbuild output
To Reproduce
go build -v -x -gcflags='all=-N -l' -ldflags '-extldflags=-static' ./cmd/bplan/
Context: testing in my own project, no other.go
source files` presentLooks like
imgui-go
conflicting withcimgui-go
, is it possible to put these lizards in one jar as in example? It was changed in "migration commit" here:Before
gofmt
automatically assignedimgui
namespace toimgui-go
library and it was building fine (after feeding bool param to ShowDemo func), but after manual change tocimgui-go
it broke :(Version
master
OS
Windows 10