Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7942243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:54:45+00:00 2026-06-03T23:54:45+00:00

I have a problem building a fairly simple local CGO project. Consider this very

  • 0

I have a problem building a fairly simple local CGO project. Consider this very small CGO package of just 3 files (glut.go, support.c and support.h file) — if I just go get it, these files are downloaded to

C:\Go\src\pkg\github.com\zombiezen\Go-GLUT\glut

then some secret magic happens and go get builds the following output file:

C:\Go\pkg\windows_amd64\github.com\zombiezen\Go-GLUT\glut.a

However, if I copy the three source files to \mytmp, cd into \mytmp and go build -o glut.a glut.go, I get some 40-60 error messages like this one:

C:\Users\roxor\AppData\Local\Temp\go-build191975110\command-line-arguments\_obj\glut.cgo2.o: In function `_cgo_b46885fb7c57_Cfunc_goCreateMenu':
./glut.go:195: undefined reference to `goCreateMenu'

If I run go get with the -x command-line argument, I can see that support.c is picked up during the build process and given to gcc:

gcc -I . -g -O2 -m64 -mthreads -I $WORK\github.com\zombiezen\Go-GLUT\glut\_obj\ -o $WORK\github.com\zombiezen\Go-GLUT\glut\_obj\support.o -c .\support.c

However, with go build -x, this is not the case, support.c is skipped. Why? How do I call go build to work exactly like go get does?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:54:46+00:00Added an answer on June 3, 2026 at 11:54 pm

    Just doing go build instead of go build somefile.go does it. So obvious now …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bit of a problem building my project. I'm getting the bellow
I have an old C++ project and I'm having problem building it. For a
So, my problem is this. I have a legacy MySQL database that I'm building
well I have a problem. I'm building a list of name.this name are obtained
I am beginner in C# programming. I have encountered small problem during building application
I have a problem building a regex. this is a sample of the text:
I'm building a micro site at the moment and I have a problem. I
I have a problem that is a little hard to explain. I am building
I have searched/Googled around but I'm struggling with the following problem. I am building
I have a weird problem building a release of an erlang application that I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.