0

Am working on a project that requires us to statically link a file and also dynamically link pthread_create and pthread_join in a C program.

I have found resources on the static linking but i cant seem to find anything on dynamic linking that that consists of just linking the certain parts of pthread.

would really appreciate any insight or resourcse

Zulu
  • 3
  • 2
  • 1
    If i'm not wrong, you don't link functions, you link libraries. However, I'm interested in seeing other responses, too. – Sourav Ghosh Nov 29 '17 at 07:23
  • You forgot to mention your specific problem. – n. m. could be an AI Nov 29 '17 at 07:25
  • 1
    What's wrong with `-lpthread`? Why do you want to link specific functions? – babon Nov 29 '17 at 07:26
  • You should show how you statically link the file that must be statically linked. Normally, `pthread_create()` et al are only provided in a shared library, so you don't get an option to statically link. However, this is platform-specific. You should identify the platform and the compiler/linker toolchain you're using too. – Jonathan Leffler Nov 29 '17 at 07:27
  • Do you want to link only specific parts of dynamic library just to reduce size of executable (thats what I am assuming you are trying to achieve)? – Arshan Nov 29 '17 at 07:43
  • Are you looking for dynamically linking functions ? if so, function pointers may help. – Abubaker Siddique Nov 29 '17 at 07:56
  • Stackoverflow.com is not a coding service. Please post what you have tried and the results. Be sure to post your compile and link statements. – user3629249 Nov 29 '17 at 08:28

0 Answers0