June 2001
Intermediate to advanced
688 pages
19h 18m
English
I can’t compile and run multithreaded applications.
Special compile-time flags and additional libraries are required when compiling threaded applications on Solaris. If you are compiling a threaded application, you must compile with the D_REENTRANT flag and link with the libpthread.a or libthread.a libraries:
cc -mt ... cc -D_REENTRANT ... -lthread cc -D_REENTRANT ... -lpthread
The Berkeley DB library will automatically build with the correct options.
I’ve installed gcc on my Solaris system, but configuration fails because the compiler doesn’t work.
On some versions of Solaris, there is a cc executable in the user’s path, but all it does is display an error message and fail:
% which cc /usr/ucb/cc % cc /usr/ucb/cc: language optional software ...