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
+34.6k Golang : Convert(cast) int64 to string
+6.5k Golang : Emulate NumPy way of creating matrix example
+7.8k Golang : Use regular expression to get all upper case or lower case characters example
+25.5k Golang : Saving(serializing) and reading file with GOB
+19.8k Golang : Get ASCII code from a key press(cross-platform) example
+15.5k Golang : Check whether a network interface is up on your machine
+8.2k Golang : Underscore string example
+17k Golang : Close channel after ticker stopped example
+37.7k Golang : Get hardware information such as disk, memory and CPU usage
+4.6k Golang : How to get capacity of a slice or array?
+36.9k Golang : How to iterate over a []string(array)
+21.8k Golang : Upload to S3 with official aws-sdk-go package