FAQ
Hi all,

I have a burning question about cgo I have not been able to answer, and it
has slowly been burning a hole in my soul.

<question> Does compiling code which uses cgo use go's own C compilers, or
does it require a compiler (like gcc) to be installed on the system?
</question>


It matters because if yes; compiling cgo- related code should be a dozy on
both windows and linux systems (assuming I can compile the library of
course).


Thanks,

Tom

--
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/groups/opt_out.

Search Discussions

  • Dmitry Vyukov at Aug 11, 2013 at 12:36 pm

    On Sun, Aug 11, 2013 at 4:15 PM, Tom D wrote:

    Hi all,

    I have a burning question about cgo I have not been able to answer, and it
    has slowly been burning a hole in my soul.

    <question> Does compiling code which uses cgo use go's own C compilers, or
    does it require a compiler (like gcc) to be installed on the system?
    </question>


    It matters because if yes; compiling cgo- related code should be a dozy on
    both windows and linux systems (assuming I can compile the library of
    course).
    Yes, it requires external (gcc) compiler.
    Having C compiler looks like a reasonable requirement if you want to
    compile and link C code.

    --
    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/groups/opt_out.
  • Tom D at Aug 11, 2013 at 1:00 pm
    I was under the impression that the Go toolchain has its own C compilers ?
    On Sunday, 11 August 2013 22:35:41 UTC+10, Dmitry Vyukov wrote:

    On Sun, Aug 11, 2013 at 4:15 PM, Tom D <hype...@gmail.com <javascript:>>wrote:
    Hi all,

    I have a burning question about cgo I have not been able to answer, and
    it has slowly been burning a hole in my soul.

    <question> Does compiling code which uses cgo use go's own C compilers,
    or does it require a compiler (like gcc) to be installed on the system?
    </question>


    It matters because if yes; compiling cgo- related code should be a dozy
    on both windows and linux systems (assuming I can compile the library of
    course).
    Yes, it requires external (gcc) compiler.
    Having C compiler looks like a reasonable requirement if you want to
    compile and link C code.

    --
    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/groups/opt_out.
  • Dmitry Vyukov at Aug 11, 2013 at 1:07 pm

    On Sun, Aug 11, 2013 at 4:59 PM, Tom D wrote:

    I was under the impression that the Go toolchain has its own C compilers ?

    Yes, it has. But Go C compilers (5c/6c/8c) can not compile what gcc can,
    the opposite is not true as well. Go C compilers are intended to compile
    "native Go" C code (in particular Go C runtime), they support Go segmented
    stacks, Go GC, calling function from other packages, etc; but they do not
    support lot of ISO C, as well as have own calling conversion.
    To compile what most people call C, you need gcc/clang.
    On the other hand, if you can compile your C code with 6c, then you do not
    need cgo at all. Then you can call Go<->C directly in both directions.



    On Sunday, 11 August 2013 22:35:41 UTC+10, Dmitry Vyukov wrote:
    On Sun, Aug 11, 2013 at 4:15 PM, Tom D wrote:

    Hi all,

    I have a burning question about cgo I have not been able to answer, and
    it has slowly been burning a hole in my soul.

    <question> Does compiling code which uses cgo use go's own C compilers,
    or does it require a compiler (like gcc) to be installed on the system?
    </question>


    It matters because if yes; compiling cgo- related code should be a dozy
    on both windows and linux systems (assuming I can compile the library of
    course).
    Yes, it requires external (gcc) compiler.
    Having C compiler looks like a reasonable requirement if you want to
    compile and link C code.


    --
    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/groups/opt_out.
    --
    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/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedAug 11, '13 at 12:15p
activeAug 11, '13 at 1:07p
posts4
users2
websitegolang.org

2 users in discussion

Dmitry Vyukov: 2 posts Tom D: 2 posts

People

Translate

site design / logo © 2022 Grokbase