I am trying to build a project on windows (go build go-client.go LogStorage.go) which was successful on linux. Taking the exact same files, it does not work on windows with some error such as:
I was wondering if someone had the same problem once? Does anyone know how to fix it? The file LogStorage.go is a smart contract generated from solidity (solc and abigen).
The reason is that Go is a compiled language. Meaning that you canât take the Compile.exe file, which you make using go build, and expect it to run on other operating systems. You should create multiple Compiled files for each operating system or run the code directly âGo runâ and let Go compile the file according to the current OS (Which will take extra time for Go to execute the code as it needs to compile it)
I think there was a solution for this like encoding utf-8 or something but I canât really remember it, sorry
Based on the error message, itâs best you raise a bug issue ticket on their GVCS (e.g. Github) to address the issue. Please remember to read their contributing guidelines.
The error log is very specific to data type mismatch which is source code problem.
This âmonkey patchingâ only works if youâre in development phase where you are exploring and developing something. The error you found is not feasible for deploying into production. Hence, address the issues to the maintainers will be the strategic step.
You are right about the Go âcross-OSâ deployment. However, itâs not the UTF-8 encoding that blocks it.
Every OS has their own specific ABI (abstracted binary interface). Hence, this is the reason why you need to compile your program for each OS.