This is the strangest problem I have ever encountered. I have a Go development environment configured on a Windows 2008 R2 virtual machine. I do not even restart it and do not start updating Windows.
Today I just realized that I can no longer run Go programs. I can successfully build and run unit tests with the go test. However, starting any compiled Go program (even a greeting) causes a pop-up window to appear called "Unsupported 16-bit application." The error message is as follows:
The version of this file is incompatible with the version of Windows you are running. Check your computer system information to see if you need the x86 (32-bit) or x64 (64-bit) version and then contact the software publisher.
The result is the same no matter which version of Go I'm using (x86 / x64). Also note that I am not using an IDE. I call go.exe to build / test from the command line.
I canβt think it over, since the work of "go test" works fine.
Any thoughts?
EDIT:
Here is the console output when building and starting the program:
build / run output
Interestingly, dumpbin assumes that something is really wrong with the executable
C:\Program Files (x86)\Microsoft Visual Studio 11.0>dumpbin /headers C:\Projects \GoPlayground\src\playground\playground.exe Microsoft (R) COFF/PE Dumper Version 11.00.51106.1 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file C:\Projects\GoPlayground\src\playground\playground.exe File Type: LIBRARY C:\Projects\GoPlayground\src\playground\playground.exe : warning LNK4003: invali d library format; library ignored C:\Projects\GoPlayground\src\playground\playground.exe : warning LNK4048: Invali d format file; ignored Summary C:\Program Files (x86)\Microsoft Visual Studio 11.0>
And here is the full source code:
package playground import "fmt" import "playground/another" func main() { fmt.Println("Hello world!") fmt.Println(another.Foobar(2)) } ------------------- package another func Foobar(i int) int { return i + 1 }
EDIT2:
I reinstalled Go twice without effect.
go
Alex G.
source share