GithubHelp home page GithubHelp logo

Comments (17)

gen2brain avatar gen2brain commented on September 25, 2024 1

There is now already a hint about CGO_ENABLED=0, I would not want some large manuals in the main README for something trivial, but if you see something of great importance, sure, why not. For example, how do you change GOOS when you want on Windows, it works the same way.

from raylib-go.

unklnik avatar unklnik commented on September 25, 2024

Just to add, this is not urgent or anything, just for users like me who don't know exactly how to implement PureGo builds it would be helpful to have a little more information available.

from raylib-go.

gen2brain avatar gen2brain commented on September 25, 2024

@unklnik You just compile with CGO_ENABLED=0. I added a hint in README.

from raylib-go.

unklnik avatar unklnik commented on September 25, 2024

OK thanks will take a look later today. I just wanted to point out that many users (like me) don't have nearly as much knowledge as yourself or @JupiterRider so we don't know how to implement things like this as easily.

from raylib-go.

unklnik avatar unklnik commented on September 25, 2024

Sorry again, just not understanding, must I download the Raylib package using this command CGO_ENABLED=0 go get -v -u github.com/gen2brain/raylib-go/raylib and then build with the .dll file?

from raylib-go.

gen2brain avatar gen2brain commented on September 25, 2024

No, you just build e.g., some example with CGO_ENABLED go build, and that example will panic unless it finds raylib.dll.

from raylib-go.

unklnik avatar unklnik commented on September 25, 2024

OK so I am on Windows 10 and in command prompt that does not work

image

from raylib-go.

gen2brain avatar gen2brain commented on September 25, 2024

That is an environment variable, so however that is used on Windows you must configure it, maybe it needs "", or set command is used, no idea, I am not a Windows user, but every user should know how to set temporary or globally some ENV.

The point here is, for example, in Linux, I can build the example for Windows just by using GOOS=windows go build, before this change I needed A MinGW C compiler, for every platform you need toolchain/compiler. The downside is that binary is not self contained, it requires raylib.dll in current dir, or somewhere globally.

from raylib-go.

unklnik avatar unklnik commented on September 25, 2024

OK will do some research later and work it out thanks appreciate the help. If I work it out can I write a small addition to the README for Windows users to get it working and create a PR?

from raylib-go.

unklnik avatar unklnik commented on September 25, 2024

Found the answer must set go environment variables go env -w CGO_ENABLED=0 and then it works, however it doesn't compile because too many things are missing

image

from raylib-go.

unklnik avatar unklnik commented on September 25, 2024

OK got it thanks

from raylib-go.

gen2brain avatar gen2brain commented on September 25, 2024

You probably are not using the latest raylib-go.

from raylib-go.

gen2brain avatar gen2brain commented on September 25, 2024

Btw. go env -w will write that change permanently to file, i.e. will set default, not sure if that is what you want, try also with "CGO_ENABLED=0".

from raylib-go.

rocktavious avatar rocktavious commented on September 25, 2024

@unklnik - did you get this working? @gen2brain i get the same errors when i

CGO_ENABLED=0 go build .

i get

../../go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:196:27: undefined: GetMouseDelta
../../go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:220:56: undefined: GetFrameTime
../../go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:226:6: undefined: IsKeyDown
../../go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:229:6: undefined: IsKeyDown
../../go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:232:6: undefined: IsKeyDown
../../go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:235:6: undefined: IsKeyDown
../../go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:238:6: undefined: IsKeyDown
../../go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:241:6: undefined: IsKeyDown
../../go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:246:8: undefined: IsGamepadAvailable
../../go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:248:29: undefined: IsMouseButtonDown
../../go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/rcamera.go:248:29: too many errors

from raylib-go.

gen2brain avatar gen2brain commented on September 25, 2024

@rocktavious Are you on Windows?

from raylib-go.

unklnik avatar unklnik commented on September 25, 2024

@rocktavious Yes, however you need to open command prompt/shell and then enter this go env -w CGO_ENABLED=0 and it should work. Basically, as far as I understand this disables the CGO compiler and it then it compiles with PureGo. Just remember to set it back to go env -w CGO_ENABLED=1 when you are done.

from raylib-go.

unklnik avatar unklnik commented on September 25, 2024

See this previous PR here d9b04a8

from raylib-go.

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.