Closed WuLiangMeiYue closed 3 years ago
Now, I have a requirement to compile the program so that it can run on an arm 32-bit single-chip microcomputer. What am I supposed to do? I'm sorry. I'm a novice. I don't know much about the compilation of Golang. And, Here is my bundler.json
{ "app_name": "HelloWorld", "icon_path_linux": "resources/icon.png", "icon_path_windows": "resources/icon.ico", "environments": [ { "arch": "arm", "os": "linux", "env": { "GOARM": "7", "CC": "arm-linux-gnueabihf-gcc", "CXX": "arm-linux-gnueabihf-g++", "CGO_ENABLED": "1" } } ] }
And then this is the mistake I made in the packing process.
2020/10/30 17:18:24 Bundling for environment linux/arm 2020/10/30 17:18:24 Binding data 2020/10/30 17:18:24 Removing C:\Users\ADMINI~1\AppData\Local\Temp\astibundler\bind 2020/10/30 17:18:24 Creating C:\Users\ADMINI~1\AppData\Local\Temp\astibundler\bind 2020/10/30 17:18:24 Creating C:\Users\ADMINI~1\AppData\Local\Temp\astibundler\bind\vendor_astilectron_bundler 2020/10/30 17:18:24 Creating C:\Users\ADMINI~1\AppData\Local\Temp\astibundler\cache 2020/10/30 17:18:24 C:\Users\ADMINI~1\AppData\Local\Temp\astibundler\cache\astilectron-0.39.0.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.39.0.zip 2020/10/30 17:18:24 Copying C:\Users\ADMINI~1\AppData\Local\Temp\astibundler\cache\astilectron-0.39.0.zip to C:\Users\ADMINI~1\AppData\Local\Temp\astibundler\bind\vendor_astilectron_bundler\astilectron.zip 2020/10/30 17:18:24 C:\Users\ADMINI~1\AppData\Local\Temp\astibundler\cache\electron-linux-arm-7.1.10.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v7.1.10/electron-v7.1.10-linux-armv7l.zip 2020/10/30 17:18:24 Copying C:\Users\ADMINI~1\AppData\Local\Temp\astibundler\cache\electron-linux-arm-7.1.10.zip to C:\Users\ADMINI~1\AppData\Local\Temp\astibundler\bind\vendor_astilectron_bundler\electron.zip 2020/10/30 17:18:24 Creating C:\Users\ADMINI~1\AppData\Local\Temp\astibundler\bind\resources 2020/10/30 17:18:24 Copying F:\WorkSpace4Go\CenterSystem\resources to C:\Users\ADMINI~1\AppData\Local\Temp\astibundler\bind\resources 2020/10/30 17:18:25 Generating F:\WorkSpace4Go\CenterSystem\bind_linux_arm.go 2020/10/30 17:18:27 Removing F:\WorkSpace4Go\CenterSystem\output\linux-arm 2020/10/30 17:18:27 Creating F:\WorkSpace4Go\CenterSystem\output\linux-arm 2020/10/30 17:18:27 Building for os linux and arch arm astilectron: 0.39.0 electron: 7.1.10 2020/10/30 17:18:27 Executing go build -ldflags -X "main.AppName=HelloWorld" -X "main.BuiltAt=2020-10-30 17:18:27.4191743 +0800 CST m=+2.532355201" -X "main.VersionAstilectron=0.39.0" -X "main.VersionElectron=7.1.10" -o F:\WorkSpace4Go\CenterSystem\output\linux-arm\binary . 2020/10/30 17:18:34 bundling failed: bundling for environment linux/arm failed: building failed: # CenterSystem D:\Go\pkg\tool\windows_amd64\link.exe: running arm-linux-gnueabihf-gcc failed: exit status 1 C:\Users\ADMINI~1\AppData\Local\Temp\go-link-597688711\000000.o: file not recognized: File format not recognized collect2.exe: error: ld returned 1 exit status
Now, I have a requirement to compile the program so that it can run on an arm 32-bit single-chip microcomputer. What am I supposed to do? I'm sorry. I'm a novice. I don't know much about the compilation of Golang. And, Here is my bundler.json
And then this is the mistake I made in the packing process.