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

errors in compilation #7

Open
niffnuff opened this issue Nov 23, 2022 · 17 comments
Open

errors in compilation #7

niffnuff opened this issue Nov 23, 2022 · 17 comments

Comments

@niffnuff
Copy link

i should say that im new to go, but not to other languages.
I found this little gem of yours searching for gerber files of bifilar coils, installed go and tried to do one of the examples ..
i get some errors, i wonder is this a go or gcc version issue ?

C:\Users\Mårten Sundling>cd C:\Users\Mårten Sundling\Documents\go-gerber-master\examples\bifilar-with-capacitor

C:\Users\Mårten Sundling\Documents\go-gerber-master\examples\bifilar-with-capacitor>go run main.go

github.com/go-gl/glfw/v3.3/glfw

In file included from ........\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3\c_glfw.go:4:
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/context.c: In function 'glfwSwapBuffers':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/context.c:646:1: error: converting to execution character set: Illegal byte sequence
assert(window != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/context.c: In function 'glfwExtensionSupported':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/context.c:680:1: error: converting to execution character set: Illegal byte sequence
assert(extension != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/context.c: In function 'glfwGetProcAddress':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/context.c:746:1: error: converting to execution character set: Illegal byte sequence
assert(procname != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ........\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3\c_glfw.go:6:
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c: In function 'glfwGetInputMode':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c:476:1: error: converting to execution character set: Illegal byte sequence
assert(window != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c: In function 'glfwSetInputMode':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c:501:1: error: converting to execution character set: Illegal byte sequence
assert(window != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c: In function 'glfwGetKey':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c:632:1: error: converting to execution character set: Illegal byte sequence
assert(window != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c: In function 'glfwGetMouseButton':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c:655:1: error: converting to execution character set: Illegal byte sequence
assert(window != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c: In function 'glfwGetCursorPos':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c:678:1: error: converting to execution character set: Illegal byte sequence
assert(window != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c: In function 'glfwSetCursorPos':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c:701:1: error: converting to execution character set: Illegal byte sequence
assert(window != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c: In function 'glfwCreateCursor':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c:734:1: error: converting to execution character set: Illegal byte sequence
assert(image != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c: In function 'glfwSetCursor':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c:820:1: error: converting to execution character set: Illegal byte sequence
assert(window != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c: In function 'glfwSetKeyCallback':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c:832:1: error: converting to execution character set: Illegal byte sequence
assert(window != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c: In function 'glfwSetCharCallback':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c:842:1: error: converting to execution character set: Illegal byte sequence
assert(window != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c: In function 'glfwSetCharModsCallback':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c:852:1: error: converting to execution character set: Illegal byte sequence
assert(window != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c: In function 'glfwSetMouseButtonCallback':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c:863:1: error: converting to execution character set: Illegal byte sequence
assert(window != NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c: In function 'glfwSetCursorPosCallback':
C:\Users\M�rten Sundling\go\pkg\mod\github.com\go-gl\glfw\v3.3\glfw@v0.0.0-20200625191551-73d3c3675aa3/glfw/src/input.c:874:1: error: converting to execution character set: Illegal byte sequence

@gmlewis
Copy link
Owner

gmlewis commented Nov 23, 2022

Hi @niffnuff - I apologize for the problems you had...
Let me dig into this and see what I can find out, then I'll report back here.

@gmlewis
Copy link
Owner

gmlewis commented Nov 23, 2022

OK, on my first try on Linux, it all worked, which unfortunately doesn't help you much:

glenn@glenn-OMEN-875 ~/go/src/github.com/gmlewis/go-gerber/examples/bifilar-with-capacitor (master) $ go version
go version go1.19.3 linux/amd64
glenn@glenn-OMEN-875 ~/go/src/github.com/gmlewis/go-gerber/examples/bifilar-with-capacitor (master) $ go run main.go
Done.

Now I'll try to run VirtualBox and boot Windows 11 10 and see if I can get it to work, and report back.

@gmlewis
Copy link
Owner

gmlewis commented Nov 23, 2022

I have a temporary workaround for you... if you remove all the code relating to the -view flag, then it should work fine for you, like this:

ksnip_20221123-162328

@niffnuff
Copy link
Author

niffnuff commented Nov 23, 2022 via email

@gmlewis
Copy link
Owner

gmlewis commented Nov 23, 2022

Hehe... probably not... I just haven't tested it on Windows.

My first attempt failed because I don't have GCC:

$ go run main.go
go: downloading github.com/gmlewis/go-fonts v0.0.7
go: downloading fyne.io/fyne v1.4.2
go: downloading github.com/fsnotify/fsnotify v1.4.9
go: downloading golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666
go: downloading golang.org/x/image v0.0.0-20200430140353-33d19683fad8
go: downloading github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200625191551-73d3c3675aa3
go: downloading github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff
go: downloading github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564
go: downloading github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9
go: downloading github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7
go: downloading golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e
go: downloading golang.org/x/text v0.3.2
# github.com/go-gl/gl/v3.2-core/gl
cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in %PATH%
# github.com/go-gl/glfw/v3.3/glfw
cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in %PATH%

So now I'm trying to install GCC from here: https://jmeubank.github.io/tdm-gcc/

@gmlewis
Copy link
Owner

gmlewis commented Nov 23, 2022

OK, well maybe you could try TDM-GCC too... once I installed that, then closed my Git Bash Shell and opened a new one, everything worked with no code edits:

ksnip_20221123-163950

Good luck! I hope it works for you!

@gmlewis
Copy link
Owner

gmlewis commented Nov 23, 2022

However, if I then add the -view flag, it dies again. 😞

zapat@DESKTOP-TCVPDH4 MINGW64 ~/go/src/github.com/gmlewis/go-gerber/examples/bifilar-with-capacitor (master)
$ go run main.go -view
Done.
2022/11/23 16:42:13 Fyne error:  window creation error
2022/11/23 16:42:13   Cause: APIUnavailable: WGL: The driver does not appear to support OpenGL
2022/11/23 16:42:13   At: C:/Users/zapat/go/pkg/mod/fyne.io/fyne@v1.4.2/internal/driver/glfw/window.go:1220

I'll see what I can figure out.

@niffnuff
Copy link
Author

niffnuff commented Nov 24, 2022 via email

@gmlewis
Copy link
Owner

gmlewis commented Nov 24, 2022

I just pushed a commit which upgrades from fyne v1 to fyne/v2 and that seems to solve the problems on Windows:

ksnip_20221124-123647

Please do a git pull on the repo and try again with the latest version.

@niffnuff
Copy link
Author

niffnuff commented Nov 24, 2022 via email

@niffnuff
Copy link
Author

niffnuff commented Nov 24, 2022 via email

@gmlewis
Copy link
Owner

gmlewis commented Nov 25, 2022

Hmm, yes, something definitely appears to be wrong... I'll investigate more tomorrow. Sorry for the troubles.

And please try to refrain from the f-bombs in this public forum, as we also attempt to be kid-friendly here for new young learners of Go. Thanks for your understanding.

@niffnuff
Copy link
Author

niffnuff commented Nov 25, 2022 via email

@gmlewis
Copy link
Owner

gmlewis commented Nov 25, 2022

OK, I just checked the results of the output in 3 locations:

Location 1: my workstation running Linux Mint 20.3 Cinnamon and Go 1.19.3:

glenn@glenn-OMEN-875 ~/go/src/github.com/gmlewis/go-gerber/examples/bifilar-with-capacitor (master) $ sha256sum big*
51976445e578950cd8342246a3990375b6bf0c4e777ded288be75d63400068da  big-bifilar-cap2.drl
85b0d0816a883e602d254b2e894f137173af0eb017c704f072162e2a094250f3  big-bifilar-cap2.gbl
b93e84a8018eed3d7f7124f6ec9a6b5a869618a3a98f2c2558dfc6fc5128c7f7  big-bifilar-cap2.gbo
a43380c9e0d764b944e71dcad99f0ecdb77e2f257acf7cc81d44e4739994a680  big-bifilar-cap2.gbs
794eaae10683db7c799e417404b69cdd1cc1c10c7b13e1053a9c844c62f1aea8  big-bifilar-cap2.gko
8734a9f068f1c7671bc0f3c321cf4a22e9742434c7cbc71b27c0b4e7d5d1ca63  big-bifilar-cap2.gtl
454a6a7b0464d83c4cd1ee7b5bec244129096dde94e25e1aefb58c63f40854ef  big-bifilar-cap2.gto
a43380c9e0d764b944e71dcad99f0ecdb77e2f257acf7cc81d44e4739994a680  big-bifilar-cap2.gts
6498809781f448aa38fd8cd18499ee3d3cba0098ff05514251ee65b688f40813  big-bifilar-cap2.zip
f54068c4edfb744f87a1e7b06eff647d46af17cd9b6418b8dffb01cae12352bb  big-bifilar-cap-layers.gif

Location 2: my workstation running Windows 10 with Go 1.19.3 and TDM-GCC:

zapat@DESKTOP-TCVPDH4 MINGW64 ~/go/src/github.com/gmlewis/go-gerber/examples/bifilar-with-capacitor (master)
$ sha256sum big*
f54068c4edfb744f87a1e7b06eff647d46af17cd9b6418b8dffb01cae12352bb *big-bifilar-cap-layers.gif
51976445e578950cd8342246a3990375b6bf0c4e777ded288be75d63400068da *big-bifilar-cap2.drl
85b0d0816a883e602d254b2e894f137173af0eb017c704f072162e2a094250f3 *big-bifilar-cap2.gbl
b93e84a8018eed3d7f7124f6ec9a6b5a869618a3a98f2c2558dfc6fc5128c7f7 *big-bifilar-cap2.gbo
a43380c9e0d764b944e71dcad99f0ecdb77e2f257acf7cc81d44e4739994a680 *big-bifilar-cap2.gbs
794eaae10683db7c799e417404b69cdd1cc1c10c7b13e1053a9c844c62f1aea8 *big-bifilar-cap2.gko
8734a9f068f1c7671bc0f3c321cf4a22e9742434c7cbc71b27c0b4e7d5d1ca63 *big-bifilar-cap2.gtl
454a6a7b0464d83c4cd1ee7b5bec244129096dde94e25e1aefb58c63f40854ef *big-bifilar-cap2.gto
a43380c9e0d764b944e71dcad99f0ecdb77e2f257acf7cc81d44e4739994a680 *big-bifilar-cap2.gts
6498809781f448aa38fd8cd18499ee3d3cba0098ff05514251ee65b688f40813 *big-bifilar-cap2.zip

and Location 3: your machine running Windows:

glenn@glenn-OMEN-875 /tmp/bifilar  $ shasum big*
799e958ebc892b59cdb15e393e2d6d0b45843cc7  big-bifilar-cap2.drl
c57c2281c1a7481d73415a94aed4b492222018ca  big-bifilar-cap2.gbl
a52cd672bacbb7b0e5a502cd9a5214551a33bae6  big-bifilar-cap2.gbo
ee9e05ecd351d2e9ab19522531143ff81367cfc7  big-bifilar-cap2.gko
8e5109b88bdff961d014e004c15649f03fe4c174  big-bifilar-cap2.gtl
2bc5148c0f2512250c7254e16a745462c7e19bf6  big-bifilar-cap2.gto
0b805179d9d34cb86e5b682279e7960643da2a85  big-bifilar-cap2.gts

The first two are identical, and yours is definitely different, and I have no idea why...

What version of Go are you running (go version) ?

@niffnuff
Copy link
Author

niffnuff commented Nov 25, 2022 via email

@gmlewis
Copy link
Owner

gmlewis commented Nov 25, 2022

Bummer. I'm stumped. I'll leave this issue open in the hopes that someone else is able to help with a solution, but I'm not sure what else to try. Sorry. 😔

@niffnuff
Copy link
Author

niffnuff commented Nov 25, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants