1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-28 07:22:20 +00:00
2018-01-12 06:35:00 +08:00

5 lines
552 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 2.8. 补充说明
本章讨论了CGO的一些常见用法并给出相关的例子。关于CGO有几点补充如果有纯Go的解决方法就不要使用CGOCGO中涉及的C和C++构建问题非常繁琐CGO有一定的限制无法实现解决全部的问题不要试图越过CGO的一些限制。而且CGO只是一种官方提供并推荐的Go语言和C/C++交互的方法。如果是使用的gccgo的版本可以通过gccgo的方式实现Go和C/C++的交互。同时SWIG也是一种选择并对C++诸多特性提供了支持。