FAQ
I'm seeing the above when trying to run a test file with the dev version
(1.5/master, which now builds successfully after yesterday's TMPDIR fix).

I've read previous discussions, and can verify:

1) 1.4 runs the test file without error
2) Xcode is installed
3) 'xcode-select --install' has also been run (unnecessarily, to verify)
4) 'gcc' runs/is found

Is there something else I should try? Thanks.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • James Bardin at Apr 14, 2015 at 3:33 pm
    Do you have C source files in your project?
    Are you using cgo?



    On Tuesday, April 14, 2015 at 10:07:11 AM UTC-4, ps wrote:

    I'm seeing the above when trying to run a test file with the dev version
    (1.5/master, which now builds successfully after yesterday's TMPDIR fix).

    I've read previous discussions, and can verify:

    1) 1.4 runs the test file without error
    2) Xcode is installed
    3) 'xcode-select --install' has also been run (unnecessarily, to verify)
    4) 'gcc' runs/is found

    Is there something else I should try? Thanks.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ps at Apr 14, 2015 at 3:48 pm
    This is a simple test file that imports `fmt` and prints to standard
    output, with the current dev version.

    1.4 (installed separately and invoked directly) executes the file without
    error, but the dev version outputs the above error.

    Everything is default.
    On Tuesday, April 14, 2015 at 11:11:41 AM UTC-4, James Bardin wrote:


    Do you have C source files in your project?
    Are you using cgo?
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Andrey mirtchovski at Apr 14, 2015 at 4:46 pm
    show us the full message that you're seeing. normally the (first)
    offending C file is printed at the end of that message:

    $ ls
    t_test.go
    $ cat t_test.go
    package main

    import "testing"

    func TestTest(t *testing.T) {
         return
    }
    $ go test
    PASS
    ok _/tmp/t 0.005s
    $ cat > t.c
    void main()
    $ go test
    can't load package: package .: C source files not allowed when not
    using cgo: t.c
    $

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ps at Apr 14, 2015 at 5:12 pm
    It's the same as this:

    http://stackoverflow.com/questions/27772831/golang-c-source-files-not-allowed-when-not-using-cgo

    But the linked suggestions (described earlier, for OS X) didn't help.

    I tried exporting GOARCH and reinstalling for 'darwin/386', but get the
    same error.
    On Tuesday, April 14, 2015 at 12:46:35 PM UTC-4, andrey mirtchovski wrote:

    show us the full message that you're seeing. normally the (first)
    offending C file is printed at the end of that message:
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ian Lance Taylor at Apr 14, 2015 at 6:59 pm

    On Tue, Apr 14, 2015 at 10:12 AM, ps wrote:
    It's the same as this:

    http://stackoverflow.com/questions/27772831/golang-c-source-files-not-allowed-when-not-using-cgo

    But the linked suggestions (described earlier, for OS X) didn't help.

    I tried exporting GOARCH and reinstalling for 'darwin/386', but get the same
    error.
    If the problem is exactly the same as that Stack Overflow question,
    then you have multiple versions of go installed on your system and you
    have set GOROOT. Don't do that. In general, never set GOROOT.

    Ian

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ps at Apr 14, 2015 at 10:51 pm
    Thanks Ian (James, andrey). Un-setting GOROOT seems to have solved the
    problem (though I had all the same settings, including GOROOT_BOOTSTRAP, on
    Mavericks, with everything working properly :/).
    On Tuesday, April 14, 2015 at 2:59:53 PM UTC-4, Ian Lance Taylor wrote:


    If the problem is exactly the same as that Stack Overflow question,
    then you have multiple versions of go installed on your system and you
    have set GOROOT. Don't do that. In general, never set GOROOT.

    Ian
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • James Bardin at Apr 14, 2015 at 4:50 pm

    On Tue, Apr 14, 2015 at 11:48 AM, ps wrote:

    This is a simple test file that imports `fmt` and prints to standard
    output, with the current dev version.

    1.4 (installed separately and invoked directly) executes the file without
    error, but the dev version outputs the above error.
    You have a C file in your package, or somewhere in your source tree.
    Try cleaning your GOROOT if you can't find the file.
    Try using the `-x` flag to see what is being invoked.

    If you're still unsure, we need to know exactly how are you invoking the
    build, what exactly is the error (it usually shows the offending file
    name), and/or contents of the package causing the problem.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedApr 14, '15 at 2:07p
activeApr 14, '15 at 10:51p
posts8
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase