You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by aconway <ac...@redhat.com> on 2015/10/15 00:09:25 UTC

Go on windows: Visual Studio, gcc, cgo Oh My!

I have spent a fruitless day trying to get the go binding to work on
windows. Here's the scoop.

cgo (the Go/C integration) requires gcc to work on windows.
gcc will not link with libraries produced by Visual Studio C++
compiler.
most proton users will be using the Visual Studio compiler.

So I think the only way to make it work on windows is to build a proton
library with gcc specially for the go binding. This needs to be kept
separate from any VS generated proton libraries installed on the same
host. As I understand it, the "idiomatic" strategy for doing this on
windows is to install them in different, randomly-named directories.
Indeed as I understand it "install" on windows means "copy to a
randomly named directory" so I guess this is not a big deal.

I'd love to hear better solutions from developers who are less windows
-hostile :)

Cheers,
Alan.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Go on windows: Visual Studio, gcc, cgo Oh My!

Posted by Virgilio Fornazin <vi...@gmail.com>.
I think MinGW should *do the work*.
You can cross-compile the code on linux or build on Windows host.

On Wed, Oct 14, 2015 at 7:09 PM, aconway <ac...@redhat.com> wrote:

> I have spent a fruitless day trying to get the go binding to work on
> windows. Here's the scoop.
>
> cgo (the Go/C integration) requires gcc to work on windows.
> gcc will not link with libraries produced by Visual Studio C++
> compiler.
> most proton users will be using the Visual Studio compiler.
>
> So I think the only way to make it work on windows is to build a proton
> library with gcc specially for the go binding. This needs to be kept
> separate from any VS generated proton libraries installed on the same
> host. As I understand it, the "idiomatic" strategy for doing this on
> windows is to install them in different, randomly-named directories.
> Indeed as I understand it "install" on windows means "copy to a
> randomly named directory" so I guess this is not a big deal.
>
> I'd love to hear better solutions from developers who are less windows
> -hostile :)
>
> Cheers,
> Alan.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: Go on windows: Visual Studio, gcc, cgo Oh My!

Posted by Chuck Rolke <cr...@redhat.com>.
----- Original Message -----
> From: "Andrew Stitcher" <as...@redhat.com>
> To: users@qpid.apache.org
> Sent: Wednesday, October 14, 2015 7:16:29 PM
> Subject: Re: Go on windows: Visual Studio, gcc, cgo Oh My!
> 
> On Wed, 2015-10-14 at 18:09 -0400, aconway wrote:
> > I have spent a fruitless day trying to get the go binding to work on
> > windows. Here's the scoop.
> > 
> > cgo (the Go/C integration) requires gcc to work on windows.
> > gcc will not link with libraries produced by Visual Studio C++
> > compiler.
> 
> I'm assuming you are using mingw (rather than cygwin).
> 
> Are you sure you are using the same 32/64 bitness in the VS and gcc
> binaries?
> 
> The basic point of mingw is to produce binaries that C ABI compatible
> with the VS objects.
> 
> So it should work.
> 
> Andrew
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 
> 

To find the bitness of a dll or exe:

1. Open a visual studio developer prompt (to wake up the dumpbin command).
2. dumpbin /headers <my.dll> | findstr machine

This types "8664 machine (x64)" or "14C machine (x86)".

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Go on windows: Visual Studio, gcc, cgo Oh My!

Posted by Andrew Stitcher <as...@redhat.com>.
On Wed, 2015-10-14 at 18:09 -0400, aconway wrote:
> I have spent a fruitless day trying to get the go binding to work on
> windows. Here's the scoop.
> 
> cgo (the Go/C integration) requires gcc to work on windows.
> gcc will not link with libraries produced by Visual Studio C++
> compiler.

I'm assuming you are using mingw (rather than cygwin).

Are you sure you are using the same 32/64 bitness in the VS and gcc
binaries? 

The basic point of mingw is to produce binaries that C ABI compatible
with the VS objects.

So it should work.

Andrew


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org