V
V
Vladimir Grabko2016-07-19 11:38:39
C++ / C#
Vladimir Grabko, 2016-07-19 11:38:39

Is it possible to use C libraries not as dynamic ones?

Let's say I want to compile all libraries into 1 binary, and even those that are written in C. In theory, I should take the library sources and specify the paths to the sources directly from Go when #include. But it even seems to be working. What pitfalls can I stumble upon with this use?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2016-07-19
@VGrabko

In theory, I should take the library sources and specify the paths to the sources directly from Go

In theory, you just need to replace linking with dynamic libraries (.so) with linking with the corresponding static libraries (.a). Sources are not needed.
Некоторые библиотеки могут иметь некоторые проблемы при таком использовании, например: https://bugzilla.gnome.org/show_bug.cgi?id=768215#c16

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question