-
-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot build on windows 10 with latest version of go #328
Comments
Finally got it working... Only took a day! is there no way of simplifying it? |
Sorry @stuartdd, I also wish that I could make it as simple as Linux at setting up go-sdl2. We definitely need a Windows expert for that 😂 |
This is the way I do it on Windows 7 (64 bit). Windows 10 might have a proper package manager with its linux subsystem, but since I do not have it, I use choco (though it got quite slow recently). Both msys2 and golang are installed using choco to make it easier to update to the latest versions later on.
It's from the top of my head, apart from package names and I might have missed something, but it's mostly straight forward once you have msys2, just don't forget to add executable to the PATH. |
Thanks for the replies. It's a art form - When faced with a combination of choices, make a enough wrong ones to prevent a solution, Iterate! I chose the wrong version of minGW, then chose badly from the selection of SDL2 downloads. Thought Ubuntu Windows 10, SubSystem would fix the gcc issue but realised too late that it was headless and would not run any way, then tried full fat cygwin, that would have worked if I had the correct SDL2 download, And so it went on. After uninstalling everything! I started from fresh, made better choices based on my previous bad ones and read the instructions more carefully! I think some clarity in the instalation instructions would help (nornal people, not me, I am doomed!), other than that I think my comments were borne out of frustration, nothing else. Keep up the really fine work you are doing. Regards Stuart |
I am finally giving up trying to build on Windows 10. Days of frustration, it should not be this complex. Building on Linux is fine. On Windows I just cannot get it to work. It's fine until I use GFX. I need to be able to build on windows so I am scrapping the whole project. Going back to Java to implement. Sorry to be so negative but it is very frustrating... |
Can you please post the errors you are getting with GFX in the build? With MSYS2 it's fairly simple to get all the dependencies. Just follow my earlier post and ask questions if you need help. You can skip first tow steps with choco and install MSYS2 manually. |
Thanks for the feedback. I spent hours installing downloading and failed. I ended up with SDL2/SDL2.h errors. I had gone down this path previously only to get more and more failed includes.. I gave up at that point. I then tried Ubuntu Windows Subsystem and intended to build (cross compile) a windows exe. This would have been sufficient, at least I could develop on windows. I finally got the cross compiler working on a simple go file but when I tried with sdl + gfx I had the same result. SDL2/SDL2.h errors. That was the final straw for me. I may come back to it when I have more time and the memory and frustration has faded. I will keep your notes and try MSYS2. Thanks again |
@stuartdd Hi, did you try new |
OK. I spent some time last night and this is the current state:
SDL project directory structureC:/Users/stuartdd/git/srcContents of gfx directoryMy Project:C:/Users/stuartdd/git/src/tools_sdl:drwxr-xr-x 1 stuartdd 197610 0 May 16 22:42 interfaces/ Go ENVGOPATH=C:\Users\stuartdd\git My Path according to GitBashPATH= |
Did you install sdl_gfx in MinGW? It is a separate package, not a part of SDL2. |
Hi. I believe that I did. Is that:
I have both:
and
On my class path. C:/Software/mingw-w64/x86_64-7.3.0-posix-seh-rt_v5-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/7.3.0/include/stddef.hok. It's the #include_next that throws it!
One thing that might help is understanding which file to download from http://libsdl.org/download-2.0.php. I went for SDL2-devel-2.0.8-mingw.tar.gz (MinGW 32/64-bit). Also a similar issue exists for Install mingw-w64 from Mingw-builds. I downloaded mingw-w64-install.exe and installed it but my libaries ar rev0. The libraries in the instructions are rev1. Would this be an issue? Also I to not have pacman so I have no equivilent to: Should I just give up and go the Msys2 route? |
@gen2brain; Could you please clarify: did you try new -tags static thing that is mentioned in release notes I cannot find where this is detailed... Maybe I have a gen0brain;-) |
@stuartdd just try |
@gen2brain Thanks for the quick reply. This is from the GitBash shell: go build -tags static tools_sdl/Setup.go I also have SDL2.dll in my path I also did
Still hopefull :-) |
@malashin @gen2brain For info this is what I had to do. Remove: Windows installations of GIT, GIT-BASH and MinGW (and any other tools that may clash). Don't remove GO but make sure it is up to date.
Exit mysys2.
Restart mysys2.
Exit mysys2.
Restart mysys2.
Install SDL2 (inside the msys2 shell)
At this point I did not see any errors so I had a party! Build your GO code.
Assuming there were no compilation errors you should be good to go! I hope this helps: Stuart |
Thank You. I have same issue (i have no idea why this problem happen suddenly) and your solution save my life 👍 I just do update(pacman -Syu) and everything work again. |
I have the same prblem and i am new to this part can you explain what happens during this process as I am not able to solve the problem after many attempts |
@suryanshv23 go-sdl2 is just bindings for the SDL2 itself and in order to use it you need to have SDL2 source files. What I explained in the post you've quoted is how to get SDL2 on Windows. Step 1 is installing choco package manager. Once this is done you can try running any go project with go-sdl2 in it and see if it works. We have some examples here, you can use this one: If it works then everything is all right, otherwise you will get an error. |
You might be interested in issue 382. If we can remove CGo on Windows, you only need a Go compiler and the |
Just to leave some feedback - I picked up it today on Windows, and had no problem whatsoever of building and running the example in readme - just followed the steps. This may be no longer an issue. |
Thanks @AndrewSav for confirming that it builds now. I will close this issue then. Feel free to reopen if it's not solved! |
I have spent two days configuring a simple go app that uses SDL2. I have done this several times on Linux. I have followed instructions from various places.
Copied from SDL zip
ld cannot find SDL2, copied from zip
followed by a whole chain of dll(s) that could not be found, about 20.
I have given up... Scrapped cygwin, MinGW and SDL.
Could somone please look at the instructions for building on windows 10.
Why is is so complex?
Could it be prebuilt for Win 10 platform.
Going back to to good old linux for now but I really needto get this working on windows 10 as well.
I have been doing this sort of thing for years and not been so frustrated for a long time :-(
Sorry if this is the wrong forum for this but I could not see any other way to discuss this issue!
The text was updated successfully, but these errors were encountered: