Giter VIP home page Giter VIP logo

Comments (12)

lexesv avatar lexesv commented on May 10, 2024 4

apt install binutils-mingw-w64

64bit
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -ldflags "-H windowsgui"

32bit
GOOS=windows GOARCH=386 CGO_ENABLED=1 CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ go build -ldflags "-H windowsgui"

from webview.

guest6379 avatar guest6379 commented on May 10, 2024 1

apt install binutils-mingw-w64

64bit
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -ldflags "-H windowsgui"

32bit
GOOS=windows GOARCH=386 CGO_ENABLED=1 CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ go build -ldflags "-H windowsgui"

compile with error:

# runtime/cgo
exec: "x86_64-w64-mingw32-gcc": executable file not found in $PATH

fixed by:
sudo apt install gcc-mingw-w64-x86-64

from webview.

allanpk716 avatar allanpk716 commented on May 10, 2024 1

sudo apt install gcc-mingw-w64-x86-64

This did not solve my issue, any other thought?

if you use ubuntu:last to run goreleaser, i try this
sudo apt-get install -y *-w64-x86-*
it worked for me.

from webview.

zserge avatar zserge commented on May 10, 2024

Ain't it a duplicate of #11? This library uses cgo, so you have to cross-compile it with some mingw toolchain, CGO_ENABLED=1 etc.

from webview.

joeblew99 avatar joeblew99 commented on May 10, 2024

ah of course.. sorry.

ok then the easiest way is to use the docker xgo then..
https://github.com/karalabe/xgo

from webview.

joeblew99 avatar joeblew99 commented on May 10, 2024

I am on OSX, not linux
i got a windows build working. Opened Windows 10 in vagrant and it ran !!

OSX failed... mhhh

go get github.com/karalabe/xgo

cd $(EX_FILE_PATH)/todo-go && xgo --out todo-win --targets=windows/*,darwin/* .

out:



Checking for required docker image karalabe/xgo-latest... found.
Cross compiling github.com/zserge/webview/examples/todo-go...
Building locally github.com/zserge/webview/examples/todo-go...
Compiling for windows-4.0/amd64...
Compiling for windows-4.0/386...
Compiling for darwin-10.6/amd64...
# github.com/zserge/webview
In file included from ../../webview.go:24:
./webview.h:1043:22: error: use of undeclared identifier 'NSWindowStyleMaskTitled'
  NSUInteger style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
                     ^
./webview.h:1043:48: error: use of undeclared identifier 'NSWindowStyleMaskClosable'
  NSUInteger style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
                                               ^
./webview.h:1044:22: error: use of undeclared identifier 'NSWindowStyleMaskMiniaturizable'
                     NSWindowStyleMaskMiniaturizable;
                     ^
./webview.h:1046:21: error: use of undeclared identifier 'NSWindowStyleMaskResizable'
    style = style | NSWindowStyleMaskResizable;
                    ^
./webview.h:1074:49: error: use of undeclared identifier 'NSEventMaskAny'
  NSEvent *event = [NSApp nextEventMatchingMask:NSEventMaskAny
                                                ^
5 errors generated.

from webview.

zserge avatar zserge commented on May 10, 2024

It requires a newer XCode: #18

from webview.

joeblew99 avatar joeblew99 commented on May 10, 2024

@zserge

Did you mean to close this ??

i am on the latest OSX & Xcode already

uname -a 
Darwin x-MacBook-Pro.local 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
Xcode
Version 9.0 (9A235)

from webview.

zserge avatar zserge commented on May 10, 2024

@joeblew99 Yes, your host environment is fine. Is it only xgo build that fails, or your local go build fails, too?

from webview.

joeblew99 avatar joeblew99 commented on May 10, 2024

local go build is fine on osx darwin.
xgo / docker is also fine for windows x86 and amd64.

I am just configuring my make file for xgo / docker build for linux and darwin.

I kind of like the docker based build using xgo because you dont need a CI travis anymore if you dont want it.

from webview.

zserge avatar zserge commented on May 10, 2024

Just pushed some changes, can you please check if this got fixed?

from webview.

hasanAjsf avatar hasanAjsf commented on May 10, 2024

sudo apt install gcc-mingw-w64-x86-64

This did not solve my issue, any other thought?

from webview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.