SolarLune / masterplan

MasterPlan is a project management software / visual idea board software. It attempts to be easy to use, lightweight, and fun.
https://solarlune.itch.io/masterplan
512 stars 46 forks source link

Can't run custom build on Windows, immediately crashes. #39

Open Pajamaland opened 3 years ago

Pajamaland commented 3 years ago

After cloning the repository into my user folder and running the build script, which seemed to run fine...

I try and launch MasterPlan.exe and it flashes open for around half a second before closing. log.txt is empty.

Is there something I'm missing here? I have GoLang, Git, GCC installed. Build runs through fine without errors.

SolarLune commented 3 years ago

Hello! Sorry for the late reply; this sounds odd.

I'm using the Visual Studio 2017 Windows image on Appveyor to build, so that means Go 1.13.10, I believe, and MinGW 7.2.0 to build.

OAguinagalde commented 3 years ago

Got same problems. Although I have no log file anywhere. Executing from the command line doesn't output anything either. Windows 10, Laptop Dell Latitude5590 although I doubt hardware or windows version has anything to do with it.

For what it's worth since I usually don't use gcc in windows I installed tdm-gcc since it was needed for building, which apparently is based on GCC 9, not sure if relevant.

But yeah, both release and demo versions have the same issue, just flash a window for a second and close. The Demo on itch however works fine, so it's likely related to the build tools?

Edit: I have actually found a difference, the demo I downloaded had a libwinpthread-1.dll file in it but the one I built didn't. Copying it doesn't solve anything though

OAguinagalde commented 3 years ago

I tried some stuff. Trying to debug it, tried printing things into console in the main function, but I coudln't manage to see anything printed for some reason? However, if I buidl it manually by doing go build .\*.go it manages to build and does indeed print my messages into console. However it breaks soon when it tries to load the icon, probably because of resources related issues. I can see that there is some stuff about the resources being done in the build script.

This is my first time doing anything in go so I don't have no clue what I'm doing really. What I have clear is that I can't print things to console with the build done by the build script and I think it's weird. I tried not using the flag -H=windowsgui thinking that might be why it wasnt printing anything but still no output anywhere. If I get some indications of how to build this manually or dig more into Go I'll try it again, but so far I have no clue how to debug this.

OAguinagalde commented 3 years ago

Nevermind the last message I must have been doing something wrong, I managed to build by removing that -H=windowsgui flag and it now outputs in console.

It seems like my issue is here *rl.LoadImage when loading the icon. If I comment that line as I dont really care about the icon, I still have problems, this time in currentProject = NewProject() a bit after the icon thing. Now that I can actually build this I might try to debug this further, but it seems related to the resources?

OAguinagalde commented 3 years ago

Further digging, when creating the NewProject, is the LoadTexture calls that are making it crash, no error message no nothing, it just fails. Also, it's not because it cant find the asset, which I thought was the case. In fact, if I try to LoadTexture of a random non existing file, it continues without issue, but when trying to load any texture that does exists, like the assets in this case, it just crashes.

I tried to clone your repo of raylib-go and change the mod file to use my local copy of your fork of raylib but nothing changes. I have no experience in Go as I said, and neither in Raylib so now for realy I can't dig deeper I think. I woudl really like to be able to build this and dig into the project as I really liked the demo. I hope I can get some support with this. After all it might be because I'm using gcc 9.2?

SolarLune commented 3 years ago

Hello, sorry for the late reply!

I wonder, what happens if you try running MasterPlan from the repo base, like you would a normal Go project (go run ./)? I don't think there's an issue with the building process; otherwise, more Windows end-users wouldn't be able to run MasterPlan.

OAguinagalde commented 3 years ago

No worries! Yes, I tried that too, no difference at all. It seems like the issue is not really in MasterPlan. The deepest I have tracked the issue is until ret := C.LoadTexture(cfileName) in func LoadTexture(fileName string) Texture2D.

// LoadTexture - Load an image as texture into GPU memory
func LoadTexture(fileName string) Texture2D {
    cfileName := C.CString(fileName)
    defer C.free(unsafe.Pointer(cfileName))
    ret := C.LoadTexture(cfileName) // <--- Here it crashes. Yes, I've checked that cfileName is correct
    v := newTexture2DFromPointer(unsafe.Pointer(&ret))
    return v
}

This is part of raylib-go and the issue is probably not even there either, and is instead somewhere in raylib? Maybe they can help @gen2brain @raysan5 ?

What bothers me is that there is literally no error no anything just silently exits, so there is no way to know. Something tells me that when raylib tries to upload the texture to the graphics card it fails and crashes silently. Now, I don't know why it would fail, I am using a fairly standard Dell Laptop here, nothing weird in my system. But again, I don't know how to keep digging here, I guess this issue should be moved to either raylib-go or raylib maybe, it might actually even be a common and easily fixable issue.

reddesertdisk commented 3 years ago

First of all I'd like to Thank you for coming up with this tool (as there's definitely a lack of offline idea boards out there) and making its source code available (as well as the instructions to build it). 🙏 I'm hoping it comes up on an Itch.io sale soon (Hopefully I'd be able to afford it by then 😅)

As for this issue I think I've managed to come upon a solution by reverting to a previous version of Go that you've mentioned (ver 1.13.10). Hopefully this helps! and Thanks again!

474r4x14 commented 3 years ago

Following on from what @reddesertdisk said, v1.14.14 also works for me whereas v1.15.7 instantly crashes like the original post mentions.

nabeelaejaz commented 3 years ago

Hi. I am having the same issue with my build. Kindly resolve. Thank you.

I am using Go version 1.16.2 - will try to see if I can use older version as suggested.

Kyllingene commented 2 years ago

I tried go run ./, but got exit status 3221225477.

EDIT: I tried the older version (1.13.10), but I got the same issue.