Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LiteIDE won't run code after building, Process failed to start

Tags:

ide

go

liteide

About a week ago I installed golang successfully on my computer and got it's terminal commands to process. So by that, I know go is on my computer.

I have been looking for a good IDE and found https://code.google.com/p/liteide/ LiteIDE which was made specifically for Go.

I read that if you already had go installed on your computer then you could use LiteIDE to start building your code right away. I must have read something wrong some where because I cannot get my projects to build at all. I think it there may be a missing/incorrect path and or something is just setup incorrectly.

This is the error I get in the console:

Current environment change id "win64-user"
C:/go/bin/go.exe env [c:\go]
set GOARCH=amd64
set GOBIN=
set GOCHAR=6
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=
set GORACE=
set GOROOT=c:\go
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set TERM=dumb
set CC=gcc
set GOGCCFLAGS=-g -O2 -m64 -mthreads
set CXX=g++
set CGO_ENABLED=1
Command exited with code 0.
First_Lite_Go_Proj  [C:/go/src/First Litel Go Proj]
Error: process failed to start.

I checked the C:/go directory to make everything there is correct and it was. Also I'm using 64bit windows 7 and double checked that as well.

Any ideas? Mine are: Missing/Incorrect Paths, Can't access a certain directory due to restrictions.

like image 289
Andrew Avatar asked Apr 29 '14 05:04

Andrew


3 Answers

While I have not tested this in Windows 7, on Windows 10, these were the steps that I took to make LiteIDE work

  1. Installed Go to C:\Go
  2. Added C:\Go\bin to PATH and made sure go was working from Command Line
  3. This was the most important step for me. Defined GOPATH in an environment variable. In my case, it was C:\Users\vivek\Documents\Source\Go. I also made sure that there were three folders src, pkg and bin were created in GOPATH. At this point go env was showing me correct values for GOPATH and GOROOT. go get, go build and go install was working as well at this step.
  4. Downloaded and unzipped LiteIDE to C:\liteide. Started LiteIDE and it worked out of the box for me. Make sure that GOPATH is seen correctly by LiteIDE by going to View > Manage GOPATH

Hope this helps. Good luck.

like image 156
Vivek Avatar answered Nov 15 '22 04:11

Vivek


It's not a good idea to keep your projects in the GOROOT path, which per default (when installed using the MSI installer) is C:\Go. Always keep it separated from there. It also helps to avoid issues with updates.

Since Go projects are made up of packages which are organized in directory structures it is important to follow a few rules and keep the working space for your Go projects separated and clean.

In my opinion its best practice to create ONE working directory as the root for ALL your Go projects somewhere in your user space and stick to it.

One way to do this is to create a directory like "work" and set the environment variable GOPATH to it (e.g. C:\Users\Peter\Documents\work). Make sure to relog or restart your computer after your changes.

Upon certain operations Go will automatically create the directories bin, pkg and src below your GOPATH.

  • src contains your created or downloaded Go source files,
  • pkg contains your installed package objects, and
  • bin contains your installed executable files.

bin or pkg will automatically be created when you use the go install command to install a binary executable or a package. It's important to understand that these are files that are not part of the Go installation.

src, if it does not yet exist, will automatically be created the first time you issue a go get command or in case of LiteIDE, the first time you create a new Go1 Command Project or Go1 Package Project. Watch the "Location:" field on the dialog box, it should include your path defined in GOPATH followed by \src (e.g. C:\Users\Peter\Documents\work\src).

In the name field enter the path you want to use for your project. If you plan to track the development of your project on Github (or other repo) it's common practice to include the path to the Git repo in your source path (e.g. github.com/petergloor/hello-go).

Of course you can use any other structure to organize your projects as long you make sure they fall below the src directory in your GOPATH.

For more information about Go workspaces read https://golang.org/doc/code.html#Workspaces.

A final note about the GOROOT environment variable. Dont explicitly set this if you install Go in C:\Go. It's enough to include C:\Go\bin in your path and to set GOPATH. GOROOT is only needed in case Go is installed at another location.

like image 35
Peter Gloor Avatar answered Nov 15 '22 05:11

Peter Gloor


I also had this problem first, but after completing the installation process, I succeeded.

Step 1:
Run (Ctrl+R) -> run target, request build first.
BuildAndRun(Ctrl+F7) -> build and run target
FileRun(Alt+F6) -> go run

step 2:
Check Config via this URL:
https://www.goinggo.net/2013/06/installing-go-gocode-gdb-and-liteide.html

like image 21
Fakhredin Gholamizadeh Avatar answered Nov 15 '22 03:11

Fakhredin Gholamizadeh