Run a gui application on cygwin - windows

I am building application that is using OpenCV lib to show images. The application fails at the following line:
cv::namedWindow(....);
I am using cygwin on Windows 10, and using CLion IDE.
The executable is built successfully but when run it shows the following error:
(Display Image:10340): Gtk-WARNING **: cannot open display:
I made sure xinit is installed and its dependencies using cygwin setup.
I've run the x server using a batch file with the following content:
c:\cygwin\bin\run.exe -p /usr/X11R6/bin XWin -listen tcp -multiwindow -clipboard -silent-dup-error
And I can see the 'X' icon in notification icons area, but still getting the error when I try to run the executable. I tried running it both from CLion and from cygwin console but same result.
What is it that I am missing?

To run a program that need access to a X Server you need:
1) a running X Server
2) the variable DISPLAY defined
If you check from Xterm you will have:
$ echo $DISPLAY
:0.0
So your program can run as DISPLAY is defined and the X server is found.

Related

How to install Golang on chrome os

I tried the method from https://go.dev/doc/install and I keep getting "-bash: go: command not found".
I tried https://gist.github.com/conoro/4fca191fad018b6e47922a21fab499ca but I dont know what command to run when I get to the "Use sftp or scp on the ARM64 device to get the tar.gz file" stage. Any help???
You don't need to compile from source in Developer mode, you can just use the Chromebrew-provided version.
If your Chromebook is relatively new, you can enable the Linux VM now built into ChromeOS to install Go without developer mode. Follow the steps from the following Google Support article to enable this feature- https://support.google.com/chromebook/answer/9145439. This has been tested on a Samsung Chromebook Plus on version 71.0.3578.127. If this feature is not available for you, you will need to enable Developer Mode.
This tutorial will show you how to install, build, and run Go on Chrome OS.
Please note this has only been tested on a 64GB LTE Pixel, however it should work on other Chromebooks. Note that enabling developer mode reduces the security guarantees offered by Chrome OS.
Install Go
First download the latest version of Go for Linux from the Go Downloads page.
After that, open a shell by hitting (CTRL+ALT+T) and typing in shell then hit enter. Then extract it using the following command (when replacing < Go Linux package > with the name of the file you downloaded):
sudo tar xpvf ~/Downloads/< Go Linux package > -C /usr/local
Go should now be installed you can test this by typing /usr/local/go/bin/go. If it installed correctly, you should see the Go help prompt. Go is now installed.
Create a Workspace
To keep this simple just create a folder called /usr/local/go/work. Also, create a folder called src inside /usr/local/go/work/.
Set PATH
Add the following to ~/.bashrc:
export GOPATH="/usr/local/go/work"
export PATH="${PATH}:/usr/local/go/bin:${GOPATH}/bin"
This will allow you to run your Go programs in your shell.
Test if it worked
First create a folder inside of your /usr/local/go/src folder. After that create a file in your folder called hello.go with the following in it:
package main
import "fmt"
func main() {
fmt.Println("Hello, Chrome OS!")
}
Now, run go install hello. Then, run ${GOPATH}/bin/hello (or just hello if you setup your GOPATH above) and you should see Hello, Chrome OS!.
Collected from : https://github.com/golang/go/wiki/ChromeOS
If you want to download Go on a Chromebook in Dev Mode, without installing Linux follow these steps:
Enable Dev mode, in case you have not already.
Download the latest version of Go for Linux (https://go.dev/dl/)
IN YOUR TERMINAL
Type Shell
mkdir ~/Coding
tar -xzf ~/Downloads/ADD YOUR VERSION HERE -C ~/Coding/
echo "sudo mount -i -o remount,exec /home/chronos/user/" >> ~/.bash_profile
echo "sudo mount -i -o remount,exec /tmp/" >> ~/.bash_profile
SET ENV VARIABLES
export GOROOT=~/CS/go *Where you extracted Go*
export GOPATH=~/Downloads/go *Where you wanna keep your Go projects*
PATH=$PATH:$GOROOT/bin:$GOPATH/bin *This adds everything to PATH*
To make sure everything works restart your Terminal and type go version you should see the version you installed

Cannot start Fuchsia Emulator on Ubuntu

I am trying to build Fuchsia OS and run it on the Fuchsia Emulator femu, but after waiting for the emulator to start the fx command exists and displays the error below.
failed to create Fuchsia device device health check failed. Unable to ssh due to error:
Error: Cannot start Fuchsia Emulator. Exit status is 1
I have followed the instructions provided by Google at fuchsia.dev, the build completes successfully and the commands used to build the OS were
fx set core.qemu-x64 --with //examples/hello_world
fx build
Subsequently, I tried running in headless mode with fx vdl start -N --headless which results in the same error as above, I also tried build the OS without the --with argument but received the same error.
The log file gives us more details, the second last line of the log file may be of interest and it reads:
emu-system-x86_64-headless: network script /etc/qemu-ifdown failed with status 256
I am using Ubuntu 21.04 on my machine.
It seems that the network configuration scripts /etc/qemu-ifup and /etc/qemu-ifdown are missing. You can work around it by installing the qemu package:
$ sudo apt install qemu

stata-se, xstata-se command not found

I can't open the GUI of Stata running on local macOS machine from remote Ubuntu server.
I have installed stata-se on my local machine, I can open X11 apps like xclock and xeyes. I'm using the following command to connect to the server:
ssh -X username#servername -p XXXX
Is there any to resolve this issue?
Since the distinction is a little unclear in the question:
According to the documentation the command to launch the Stata SE GUI is:
xstata-se
while
stata-se
launches the console version.
Since these are not working you can confirm the syntax diagram with:
stata -h
which will tell you the correct syntax, if Stata is actually installed.
If you are seeing something like:
$ command not found: Stata
then you may, similar to this, need to make sure that the path to Stata is properly set in your path file. Exactly how you do this depends on your terminal and operating system.

running xvfb-run on OS X 10.11

Is it possible to get xvfb-run to work in the newest version of OS X? I've installed XQuartz and Xvfb runs the scripts with the following command:
Xvfb :4000 & export DISPLAY=:4000 & rspec
instead of this one:
xvfb-run rspec
This is however not without fault, either the temp file "x4000-lock" will not get removed after the script is finished and stop Xvfb to start up again or I'll recieve this error next time the script runs:
[2] 13220
[3] 13221
_XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
(EE)
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE)
Run options: include {:focus=>true}
This error is also recieved on a linux system so i Suspect "xvfb-run" is doing something more in the background and thus wondering how to get that running in OS X

JSP, OSX 10.9.4 & ImageMagick - "/opt/local/bin/identify": error=2, No such file or directory

I am currently working on a large legacy JSP project - not that I know anything about JSP. I have tried to set up the app in IntelliJ and I have set numerous keys in my .MacOSX/environment.plist file however when I try to upload an image (ImageMagick is used) in my local environment in the application I get the following error in the debug terminal (the error is all on one line):
.ImageUploadException: command /opt/local/bin/identify -format %w;%h; - failed: java.util.concurrent.ExecutionException: java.io.IOException: Cannot run program "/opt/local/bin/identify": error=2, No such file or directory
to make the error easier to read
.ImageUploadException: command /opt/local/bin/identify -format %w;%h;
- failed: java.util.concurrent.ExecutionException: java.io.IOException:
Cannot run program "/opt/local/bin/identify": error=2, No such file or directory
After some research I create a launchd.conf file in the /etc folder and added the following line as advised on Stackoverflow and some other places:
setenv PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
I rebooted and I still get the same error? If I run echo $PATH in my terminal I get the following:
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
Does anyone know what I am doing wrong? I am using a MacBook Pro running OS X 10.9.4 and MacPorts is installed as when I run $ which port I get the following: /opt/local/bin/port
Thanks in advance
What I did was reinstall the X-Code tools and reinstalled ImageMagick after the amends above... it all seems to work now?

Resources