Giter Site home page Giter Site logo

Comments (6)

gen2brain avatar gen2brain commented on July 17, 2024 1

@ivanmartos @asish-tom-fin See https://stackoverflow.com/questions/5245444/cross-compiler-for-linux-on-mac-os-x/14145566 and https://blog.filippo.io/easy-windows-and-linux-cross-compilers-for-macos/.

from go-fitz.

gen2brain avatar gen2brain commented on July 17, 2024

Hello,

You cannot just cross compile with simple GOOS=linux GOARCH=amd64 go build for example, library uses https://golang.org/cmd/cgo/, so you need to have compiler and toolchain for arch you want to build for. Also, enable CGO_ENABLED=1.
For example I have on my Linux system mingw toolchain in /usr/x86_64-w64-mingw32 and x86_64-w64-mingw32-gcc in PATH, so I can just CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build to cross compile for Windows.

Not sure how you can do that on macOS. Library uses precompiled mupdf libraries, but they still need to be linked at the end with the appropriate toolchain.

from go-fitz.

czh0318 avatar czh0318 commented on July 17, 2024

Thank you very much. I will try it

from go-fitz.

ivanmartos avatar ivanmartos commented on July 17, 2024

@czh0318 how did you pls manage to fix it?

from go-fitz.

asish-tom-fin avatar asish-tom-fin commented on July 17, 2024

Thank you very much. I will try it
@czh0318 czh0318
Hi, are you able to cross-compile it in mac?

from go-fitz.

gen2brain avatar gen2brain commented on July 17, 2024

I used https://github.com/tpoechtrager/osxcross in Linux to build macOS binary, not exactly for this project, but it should be the same. I know I saw Linux binary toolchain for MacOS on github recently, but with a quick search, I didn't found it.

from go-fitz.

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.