lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.78k stars 885 forks source link

Getting TTM_ADDTOOL failed with .exe.manifest (solved) #733

Open tmzt opened 3 years ago

tmzt commented 3 years ago

Building using the suggested manifest failed to display any window and MainWindow returned an error with "TTM_ADDTOOL failed".

I used the test manifest verbatim.

I attempted to build the rsrc.syso as suggested in the Walk documentation, which returned an error like:

C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: $WORK\b001\exe\a.out.exe: .rsrc merge failure: corrupt .rsrc section

After researching I found this issue, which suggests that the problem was caused by using TDM 9.2.0:

https://github.com/josephspurrier/goversioninfo/issues/39

The solution was to

go get -u github.com/tc-hib/rsrc

With this I was able to compile the test manifest into the .exe and successfully display a MainWindow.

tmzt commented 3 years ago

I would suggest updating the rsrc dependency and/or instructions in the README to use that fork of rsrc instead.

tc-hib commented 3 years ago

Hello, please do not use my fork anymore. It was a quick and dirty fix. Akavel has properly fixed rsrc and I have developed my own tool too, with more features: https://github.com/tc-hib/go-winres

I might delete my forks someday.