I am porting an open source program, Felix http://
felix.sourceforge.net, to OS X 10.4 using Apple Developer Tools'
gcc 4.0.1. In the process of building Felix I found that small
threaded programs do not require linkage to the pthread library--
you do not need to add -lpthread to the gcc or g++ compiler
commands to run the program.
Is -lpthread necessary for gcc 4.0.1?
No, all the pthread support is in libSystem, which is linked in
implicitly.
Does -lpthread add any special flags that might be necessary in a
more complex program?
Nope. On Mac OS X, /usr/lib/libpthread.dylib is a symlink to
libSystem.dylib for compatibility with existing open source makefiles
that use -lpthread. Adding -lpthread to the link line doesn't change
the resulting output file at all.
There's no advantage to "fixing" the makefiles to remove -lpthread,
so I'd suggest just leaving it in.
matt.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/email@hidden