Comments (17)
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.
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.
@unklnik You just compile with CGO_ENABLED=0. I added a hint in README.
from raylib-go.
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.
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.
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.
OK so I am on Windows 10 and in command prompt that does not work
from raylib-go.
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.
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.
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
from raylib-go.
OK got it thanks
from raylib-go.
You probably are not using the latest raylib-go.
from raylib-go.
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.
@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.
@rocktavious Are you on Windows?
from raylib-go.
@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.
See this previous PR here d9b04a8
from raylib-go.
Related Issues (20)
- Misleading use of color type RGBA. HOT 2
- No function for `GuiLoadIcons` HOT 1
- Cross compiling error HOT 6
- Can't debug via go-delve on M1 MacOS. (missing rodata struct member) HOT 1
- Issues with using DLL on Windows HOT 1
- Adding `SwapScreenBuffer()` and `PollInputEvents()` functions HOT 3
- Can not build for windows/darwin HOT 2
- errors with camera on fedora HOT 3
- Unable to remove status bar from raygui Panels HOT 11
- Not support win7? Is there any way to work with win7? HOT 3
- delve fails to build, can't find utils_log.h HOT 9
- strange errors HOT 2
- Crash after LoadModel / Texture HOT 5
- The android template doesn't load assets on Windows HOT 7
- Request to add ExportWaveAsCode HOT 3
- Can't run without Xinerama HOT 2
- SIGSEGV: segmentation violation HOT 3
- Raylib Go is Slow? HOT 16
- Windows purego errors HOT 3
- How to show CJK chars or fonts in raylib-go HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raylib-go.