PaperCutSoftware / silver

SILVER - A cross-platform service/daemon wrapper with in-build auto-update, crash resilience and more.
MIT License
54 stars 13 forks source link

silver make.go failed #2

Closed bu763 closed 9 years ago

bu763 commented 9 years ago

I met a problem about silver and had been trying two day without progress.

I got the source of silver, alse setup go lang in my pc.

Then I executed "go run make.go setup" without any error, when I executed "go run make.go",

The error msg was "Godeps_workspace\src\code.google.com\p\winsvc\mgr\service.go:8:2: C source files not allowed when not using cgo: sys.c."

I set CGO_ENABLED=1 ,but it didn't work.

Using cgo seems necessary during "go run make.go", but I could not how to use cgo, are there any clue for solving it?

Windows edition : Windows 7 ultimate 32 bit

This is my environment varibles in pc. -----------------env begin------------------- set GOARCH=386 set GOBIN= set GOCHAR=8 set GOEXE=.exe set GOHOSTARCH=386 set GOHOSTOS=windows set GOOS=windows set GOPATH=C:\go_path;D:\mygo; set GORACE= set GOROOT=C:\Go set GOTOOLDIR=C:\Go\pkg\tool\windows_386 set CC=gcc set GOGCCFLAGS=-m32 -mthreads -fmessage-length=0 set CXX=g++ set CGO_ENABLED=1 -----------------env end-------------------

alecthegeek commented 9 years ago

Which version of go are you using?

Using Go 1.5 on a Mac this builds OK.

bu763 commented 9 years ago

alec thank you so much.

I have used the version of 1.4.2, now I have downloaded the version of 1.5. I hope it works. I will try go 1.5 later.

Fanli Bu

bu763 commented 9 years ago

alec

I tried in go 1.5, but the same question occurred.

Godeps_workspace\src\code.google.com\p\winsvc\mgr\service.go:8:2: C source file s not allowed when not using cgo or SWIG: sys.c godep: go exit status 1

the file "\silver\build\windows\updater.exe" had been built, but service.exe can be built.

Fanli Bu

codedance commented 9 years ago

You'll need to build with go1.3 for the code base to work as it stands. I'm in the process of updating the code to work with 1.4/1.5.

bu763 commented 9 years ago

Dear Chris

I am Fanli Bu. I really appeciated for your help.I will build silver in go 1.3. If you have update the silver source code, please let me know.

Regards Fanli Bu

codedance commented 9 years ago

Hi Fanli,

I've updated the code to work correctly under 1.4. Please pull the update and build again with

go run make.go

bu763 commented 9 years ago

hello chris

I have pull the update and tested with go run make.go, it is ok. I have built the service.exe, service_no_http.exe, updater.exe.

Then I will wrap a sample java application service. I hope it will work.

Regards Fanli Bu

alecthegeek commented 9 years ago

I'll close the issue. Please reopen it if needed.