You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Alessio Gottardo <ta...@yahoo.it.INVALID> on 2017/10/20 17:17:35 UTC

Set CGO_LDFLAGS and CGO_CFLAGS on Windows 10 to install electron with golang

Hi,
I wanted to use the electron package for golang so I went here: https://github.com/apache/qpid-proton/tree/master/examples/go where it is said that I need to compile the proton-C library.
I cloned that project with: "git clone https://github.com/apache/qpid-proton"
I followed the steps here: https://github.com/apache/qpid-proton/blob/master/INSTALL.md- I installed CMake from their websites and used it with its full path (the cmake from Cygwin was not finding stuff related to C++ compilers and/or environment variables but from the output I've seen it was trying to compile this project using GCC)- I run this command from powershell from within the "build" directory: "& 'C:\Program Files\CMake\bin\cmake.exe' .."- I used the "swig" command provided by Cygwin (it's in the PATH).- I have to mention that when installing Visual Studio 2017 I included the CMake tools as explained in here: https://stackoverflow.com/a/46518629/1264920- I opened Visual Studio as an administrator and I opened the ALL_BUILD project, then I clicked Build > Build ALL_BUILD. The output from the console seems to prove I've successfully built this project e.g. saying at the end "========== Build: 58 succeeded, 0 failed, 0 up-to-date, 0 skipped =========="
I went back to the electron docs where it is said to run "go get qpid.apache.org/electron" with a couple of environment variables that from my understanding should point to somewhere inside the "build" directory I've used to compile the code with Visual Studio.
I tried using Cygwin to export one of the 2 variables like this: export CGO_CFLAGS="-IC:\Users\<MY_USER>\<MY_PATH>\qpid-proton\build\proton-c"However the "go get" command keeps complaining it does not find this header file: "proton/error.h"I searched for that header file but in the "build" directory there is not such file.There is one header file "version.h" in <MY_PATH>\qpid-proton\build\proton-c/include/proton/ though (I am not sure this is relevant).Also: I don't know how to set the CGO_LDFLAGS environment variable because in the "build" directory I can not find the "lib" directory that is mentioned in the docs.
How can I install this electron golang package on Windows?Is the build procedure on Visual Studio enough to assume I've built qpid-proton? If yes, then where are these header files that I can not find when inspecting the file system?
Thank youAlessio