How to install opengl for this to run - user-interface

I am trying following simple code to create a GUI using Fyne package:
// from: https://github.com/fyne-io/fyne
package main
import (
"fyne.io/fyne/widget"
"fyne.io/fyne/app"
)
func main() {
app := app.New()
w := app.NewWindow("Hello")
w.SetContent(widget.NewVBox(
widget.NewLabel("Hello Fyne!"),
widget.NewButton("Quit", func() {
app.Quit()
}),
))
w.ShowAndRun()
}
It compiles and builds executable file without any error or even warning, but on trying to run it gives following error:
I:\>rnfynetest
2019/08/25 12:37:18 Fyne error: failed to initialise OpenGL
2019/08/25 12:37:18 Cause: glBeginConditionalRender
2019/08/25 12:37:18 At: C:/Users/ABCD/go/src/fyne.io/fyne/internal/driver/gl/window.go:1007
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x2c pc=0x572afd]
goroutine 1 [running, locked to thread]:
fyne.io/fyne/internal/driver/gl.(*window).SetContent(0x0, 0x8fc5e0, 0x1386e0c0)
C:/Users/ABCD/go/src/fyne.io/fyne/internal/driver/gl/window.go:361 +0x1d
main.main()
I:/rnfynetest.go:10 +0x1ce
As given on Fyne homepage I need to install OpenGL. From go bindings for OpenGL it seems there are three ways to install it:
go get -u github.com/go-gl/gl/v{3.2,3.3,4.1,4.2,4.3,4.4,4.5,4.6}-{core,compatibility}/gl
go get -u github.com/go-gl/gl/v3.1/gles2
go get -u github.com/go-gl/gl/v2.1/gl
Which of these commands do I need to use? I am working on Windows7 and using go version go1.12.9 windows/386
Thanks for your help.
Edit:
I tried following commands:
go get -u github.com/go-gl/gl/v2.1/gl
go get -u github.com/go-gl/gl/v4.6-core/gl
go get -u github.com/go-gl/gl/v4.6-compatibility/gl
They all install all right but same error is persisting on trying to run built executable.
I also tried gles2 but it does not install rather gives following error:
I:\>go get -u github.com/go-gl/gl/v3.1/gles2
# github.com/go-gl/gl/v3.1/gles2
C:\Users\ABCD\go\src\github.com\go-gl\gl\v3.1\gles2\package.go:38:11: fatal error: KHR/khrplatform.h: No such file or directory
// #include <KHR/khrplatform.h>
^~~~~~~~~~~~~~~~~~~
compilation terminated.

The OpenGL libraries typically come from your graphics card drivers, and looks like Fyne-io needs fairly new Graphics Card Drivers. (It uses OpenGL 3.2 which was released around 2009 It uses OpenGL 2.0). So you can try to:
Use a Software Implementation of OpenGL using the Mesa project, which should be "good enough" for most desktop apps use cases - more details here: https://fdossena.com/?p=mesa/index.frag
Or
Update your Graphics Card drivers - If they are available for your hardware, to get GPU accelerated OpenGL. Definitely try this this if you are planning on making a graphics intensive application).
Edit: Updated the version of the OpenGL context Fyne uses

Related

GOlang core dump analysis using delve throws error 'unrecognized core format'

Iam trying to analyse core file of GO program generated by gcore using delve. Below are steps I have followed. I got Unrecognized format error
$go version
go version go1.13.1 darwin/amd64
$/Users/sudhakar/go/bin/dlv version
Delve Debugger
Version: 1.4.0
Build: 37bee98a8821843314b561bc6ab328dfff2aad1b
$./hello &
[1] 72335
$gcore 72335
$sudo gcore 72335
$/Users/sudhakar/go/bin/dlv core ./hello /cores/hello-72335-20200427T185443Z
unrecognized core format
At the time of this post darwin/amd64 is not supported by delve.
Ref: https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_core.md
However this can change over time (delve may add support to this arch) attaching screenshot of documentation (at the time of this post)
Special thanks to delve-dev list member (Choudhary Sourya Vastayan) who pointed me to this.

cannot execute binary file of golang bootstrap installer

I'm using the instructions in this blog post, which is intended for installing go 1.5 on the Raspberry Pi, to install golang on my Chromebook (which has ChrUbuntu not Chromium installed). The technique recommended in the blog post is to install a Golang 1.4 bootstrap compiler available here and then use that to build golang 1.5 (as you need a version of go installed to build 1.5). I tried this on the Raspberry pi and it worked, but when I ran this command from /go/src on ChrUbuntu
env GO_TEST_TIMEOUT_SCALE=10 GOROOT_BOOTSTRAP=$HOME/go-linux-arm-bootstrap ./all.bash
It gave me this output
env GO_TEST_TIMEOUT_SCALE=10 GOROOT_BOOTSTRAP=$HOME/go-linux-arm-bootstrap ./all.bash
# Building C bootstrap tool.
cmd/dist
./make.bash: line 121: /home/user/go-linux-arm/bootstrap/bin/go cannot execute binary file
Why am I getting this error message (is it because it's not compatible with ChrUbuntu) and how to do what I am trying to do. Thank you in advance.

How can I train Tesseract on Windows

I am trying to train tesseract for work on windows. The process finish well but when I make the call to
tesseract.exe file.tiff out
after this the run, file is empty.
I donĀ“t know what is happen here, I did the same process under linux and work perfectly.
I think that the problem could be the generation with the mftraining.exe.
It throw this messages:
Warning: no protos/configs for a in CreateIntTemplates()
Warning: no protos/configs for f in CreateIntTemplates()
Warning: no protos/configs for l in CreateIntTemplates()
Warning: no protos/configs for o in CreateIntTemplates()
Warning: no protos/configs for r in CreateIntTemplates()
Error: no configs for class a in mftraining
Error: no configs for class f in mftraining
Error: no configs for class l in mftraining
Error: no configs for class o in mftraining
Error: no configs for class r in mftraining
any other end without problems
Somebody can help me please?
I know the question is old, but if you're looking for a way to train current version of Tesseract (4+) on Windows, I have created a GUI that automates all the process. It requires Python 3. Here is my GitHub repository that contains all the sources and compiled portable executable file.
did you try to follow this manuel from google on how to train tesseract ?
https://code.google.com/p/tesseract-ocr/wiki/TrainingTesseract3
According to here:
Training is not supported on windows.
If you want to test/fix something, use the current code from repository (it should be posible to build it with msys2 on windows)
Training tools are only included in Tesseract 3.03+. Separate commands are used to build the main program tesseract.exe and the training tools. Shown as below.
I have successfully built the main program on Windows 7 with MSYS2. But I failed to build the training tools.
Update
Now I have turned to use Xubuntu to build both the main program and the training tools. And the training process can be carried out. Though there's a lot of details to be tuned.

dbx: internal warning writable memory segment of size 0

While trying to load a core file using dbx I get the following warning:
dbx: internal warning: writable memory segment 0xfa8b0000[16384] of size 0 in core
There doesn't seem to be an explanation in:
(dbx) help core
What does this message mean?
EDIT
The rest of the output:
core file header read successfully
Reading ld.so.1
dbx: internal error: signal SIGBUS (invalid address alignment)
dbx's coredump will appear in /tmp
Abort (core dumped)
And dbx exits without loading the core.
Got solved by upgrading Solaris Studio to version 12.3 and using the newer dbx from there.
One of the reasons why this could happen is because dbx expects the absolute path to get the object files, try giving the
dbx <PATHTOBINARY>/binaryfile
Of course, you can upgrade dbx to the latest version to fix the same.

gomobile bind hello error

Go 1.5 and 1.6 both new installs with gvm, I'm trying to create a android binding of the basic hello world example.
Ubuntu 14.4 long support on a old 32bit laptop i use for trying new things. After getting gomobile and gomobile init everything works. can build and install. The android sdk is new and properly set. I just can't find anything about the error.
gomobile bind hello
gomobile: loadExportData failed go install -p=2
-pkgdir=/home/mrlarge/.gvm/pkgsets/go1.6/global/pkg/gomobile/pkg_android_amd64
-tags="" -gcflags=-shared -ldflags=-shared hello failed: exit status 2
hello
/home/mrlarge/.gvm/gos/go1.6/pkg/tool/linux_386/link: -shared and -buildmode=pie are incompatible
P.s. Sorry the top part must of got deleted, Sleepy touchpad error i suppose..
It was an error in go1.6.2 that caused it i downgraded to 1.6 and everything was fixed. Its reported

Resources