On Tuesday, 21 January 2014 15:06:08 UTC+11, Curtis Paul wrote:
> ... The problem is, Matlab's windows libraries/headers do not support gcc. The Windows SDK compiler (cl.exe) does compile the Matlab windows libraries/headers however.
Does Matlab comes in a form of DLLs? If yes, you should be able to call them directly from Go. That is what we do for all Windows APIs. You just need to "translate" them to Go. See %GOROOT%\src\pkg\syscall\zsyscall_windows_386.go for some examples.
> ... Golang CGO apparently wants to use gcc, and I can't find any information about how (if possible) to change the C compiler CGO uses.
cgo does use gcc on windows. You can look at the source in %GOROOT%\src\cmd\cgo to see what it does, perhaps you could make it work with MS compiler. You will, probably, need to change the linker (%GOROOT%\src\cmd\ld\ldpe.c) as well - Go linker need to be able to understand object files generated by MS compiler. I think it will get complicated quickly.