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
+5.7k Fix yum-complete-transaction error
+8.4k Golang: Prevent over writing file with md5 hash
+7.9k Javascript : Put image into Chrome browser's console
+9.1k Golang : Handle sub domain with Gin
+12.6k Golang : Transform comma separated string to slice example
+17.8k How to enable MariaDB/MySQL logs ?
+10k CodeIgniter : Load different view for mobile devices
+10k Golang : Channels and buffered channels examples
+10.6k Golang : Select region of interest with mouse click and crop from image
+25.4k Golang : Convert long hexadecimal with strconv.ParseUint example
+11.6k Android Studio : Create custom icons for your application example
+27.4k Golang : Convert CSV data to JSON format and save to file