New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to get gcc #245
Comments
You will need to install MinGW-w64. |
Thanks. I downloaded the mingw-w64-master package (zip) and put it into my go/src folder, but when I try to run the gui.go demo I still get the same message. I thought maybe I need to do go install mingw-w64-master, but that comes back with: "can't load package: package mingw-w64-master: no buildable Go source files in C:\installed programs\go\src\mingw-w64-master". I looked into the mingw-w64-master folder, and there is no gcc executable there. |
That's not how you install MinGW-w64. You'll need to extract that somewhere global, such as in |
OK, Thanks. So @i installed msys32, All went well (very verbose), exactly as the msys32 install instructions say. I now have a mingw64 folder, whose bin folder I added to my 'path' in my environment variables. Still, when I try to run the gui demo I get " # ui-master exec: "gcc": executable file not found in %PATH%". When I look in the mingw64 folder with windows explorer, it turns out the folder is empty. (The mingw64.exe is in the msys32 folder.) |
I want to understand more about above. I want to understand why is it needed, when cgo.exe already exists in (some sub-folder of) go directory. Also why cannot we tell go to use tool "cgo" rather than using gcc? I have installed Go version 1.10.3
I know there is some issue about cgo / gcc mentioned on below links: I however feel using the Go tools provided with the Go installer is much better than using a modified or a third part executable. Is it possible for anyone on this group to help set the right paths (as it is quite possible that most of them might not be set) and suggest the right commands to first test building code with command-line commands and then using GoClipse? Test code that I gathered from various places (including from folders within C;\Go):
|
cgo is not a C compiler; it uses your C compiler to turn C code into binary objects that are linked together with the binary objects that Go produces from your Go files. The C compiler is separate entirely. |
@andlabs I am referring to book THE WAY TO GO - A Thorough Introduction to the Go Programming Language by Ivo Balbaert, copyright year 2012: On page 43 following pints are mentioned: Point 1: Point 2: Observation Also why would the book use the words:
if it invokes gcc for compiling c code? |
Test code to find various System Variable and other variable settings:
Observed output:
|
When import for c and unsafe are not included reported compiler is But with below import included:
build is terminated with:
|
That book is either being misleading or flat out wrong (cgo does NOT replace the standard Go compilers). cgo interprets the names because cgo programs are syntactically valid Go programs that can be parsed with a Go parser; cgo just parses the program and changes every instance of Also Go already provides your test code as What errors do you get with MinGW installed? Is this vanilla MinGW or MinGW-w64? You'll need the latter. |
Yes, I have installed the latest MinGW-w64. I have added path for C:\mingw-w64\x86_64-8.1.0-win32-sjlj-rt_v6-rev0\mingw64\bin to System Variable PATH. I am not sure whether path to any other MinGW-x64 need to be added. Folder msys is not present inside any of the main or sub folders associated with MinGW-w64 On building code, I observe below output along with errors:
Build code stated below for reference purpose:
I am not aware why the word "code" appears in build information instead of "main". The src folder has folder with name code. Inside code folder file "RunTimeVard.go" exists, which has the shared code init. I had accidentally built / compiled the empty project (i,e, when only "package code" existed inside the go file). I later changed "package code" to "package main" but I still observe the word "code" in Build output. |
I am using GoClipse for building code. |
Oh, the newline between the |
Are there still issues? |
No.Thanks.
…On Friday, January 4, 2019, Pietro Gagliardi ***@***.***> wrote:
Are there still issues?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#245 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/APvuYgk0k1VrpH6XNXCc0Fl5b-QMY_spks5u_45XgaJpZM4PmMR1>
.
|
I installed ui-master to run a gui using golang, and I am trying to run the demo via command prompt. I get the message "# ui-master exec: "gcc": executable file not found in %PATH%". Where/how can I get that? I found a gcc written in perl, but that can't be it, right?
The text was updated successfully, but these errors were encountered: