- If I want to link with pthread, I can
-lpthread
,right? - I still don't see the reason to use
-rdynamic
after reading the manual..
Asked
Active
Viewed 2,273 times
1 Answers
3
-pthread
is shortcut for-D_REENTRANT -lpthread
. On Linux. It is shortcut for whatever is appropriate on other platforms where the library may be called differently. See this question.- Well, I think
-rdynamic
is explained quite well in the manual. It is needed if you want to have dynamic symbol information in an executable, which is useful for getting backtrace (in absence of debug information) and usingdlsym
to find symbols dynamically (e.g. GtkBuilder's autoconnect uses this).
-
@new_perl: You can use `dlsym` from shared library and/or plugin (which is shared library) to your heart's desire. It's only the rare case of using `dlsym` on the executable itself and there may be other options that imply exporting the symbols too. – Jan Hudec Aug 02 '11 at 19:11
-
Can you elaborate why GtkBuilder's autoconnect uses that? – new_perl Aug 03 '11 at 00:55
-
@new_perl: It has XML with the widget declarations and it may include names of functions that should handle events (signals). And it uses `dlsym` to get the functions and connects them to the signals. – Jan Hudec Aug 03 '11 at 08:29