Golang : How to solve "too many .rsrc sections" error?
Problem:
During go build
you encounter this error "too many .rsrc sections" and the compilation process stopped. What's going on?
Solution:
The error message originated from this function :
func setpersrc(ctxt *Link, sym loader.Sym) {
if rsrcsym != 0 {
Errorf(nil, "too many .rsrc sections")
}
rsrcsym = sym
}
Chances are you have more than 1 .syso
file in your build and linking process. Such as one for embedding icon into your executable and another one for embedding a manifest file.
rsrc -manifest app.exe.manifest -o app.syso
To solve this problem. First, remove ALL the .syso
files and then ONLY generate 1 .syso
file. Combine the icon and manifest file together when using the rsrc
tool.
Hope this helps and happy coding!
See also : Golang : What fmt.Println() can do and println() cannot do
By Adam Ng(黃武俊)
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+7.3k Gogland : Single File versus Go Application Run Configurations
+13.9k Elastic Search : Mapping date format and sort by date
+14.3k Golang : Get URI segments by number and assign as variable example
+13.9k Golang : syscall.Socket example
+12k Golang : Flush and close file created by os.Create and bufio.NewWriter example
+5.2k Gogland : Datasource explorer
+5.5k Unix/Linux : Get reboot history or check when was the last reboot date
+12.9k CodeIgniter : "Fatal error: Cannot use object of type stdClass as array" message
+14.3k Golang : How to get URL port?
+19.5k Golang : Append content to a file
+4.5k JavaScript: Add marker function on Google Map
+5k Python : Convert(cast) string to bytes example