3 ms·
Great article. But I gave up on static linking in Linux after trying to static link a distributed network client we build in a University project that makes he
by nisa 14y ago
Great article.
But I gave up on static linking in Linux after trying to static link a distributed network client we build in a University project that makes heavy use of C++11 std::thread and Boost. It compiles fine, but segfaults on startup. This is a known issue[1] but I did not investigated further.
It appears for me as an complete outsider to glibc/gcc Linux development that static linking is discouraged in Linux[2].
1: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52590 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52590
2: http://sourceware.org/bugzilla/show_bug.cgi?id=10652 http://sourceware.org/bugzilla/show_bug.cgi?id=10652
- eliben 14y agoStatic linking has its problems, especially when shared data and multithreading are involved. Or memory management. Dynamic linking has its problems though (DLL/DSO hell is just one). It's a tradeoff. But yes, it is also my understanding that dynamic linking is preferred. It's also what I usually do unless I have a good reason not to.