Member Avatar for Member #313863

i try to complile fcgiwrap from on solaris 10 platform

however i got this error msg

# make
gcc -std=gnu99 -Wall -Wextra -Werror -pedantic -O2 -g3 fcgiwrap.c -o fcgiwrap -lfcgi
ld: fatal: library -lfcgi: not found
ld: fatal: File processing errors. No output written to fcgiwrap
collect2: ld returned 1 exit status
make: *** [fcgiwrap] Error 1

any idea how to fix it? thanks.

Dani AI

Generated

The linker error means the build compiler cannot find a FastCGI development library to link against. was on the right track — small correction first: the Solaris package contents file is /var/sadm/install/contents (not “conents”). Beyond that, these concrete checks and fixes usually resolve the problem.

Locate and inspect any installed libfcgi and the symlinks (you need the unversioned .so for linking) and verify ABI (32 vs 64‑bit):

find / -name 'libfcgi*' 2>/dev/null
file /path/to/libfcgi.so*
ls -l /path/to/libfcgi.so*

If you only see a versioned soname like libfcgi.so.0 but no libfcgi.so, install the FastCGI “development” package or create a correct libfcgi.so symlink (only as a last‑resort if you know it really matches). Also confirm the library’s architecture with file; a 64‑bit lib won’t link into a 32‑bit build and vice versa.

When the library exists but isn’t in the linker’s search path, add the directory at link time and set a runtime search path. Example:

gcc -std=gnu99 -O2 fcgiwrap.c -L/opt/sfw/lib -Wl,-R,/opt/sfw/lib -lfcgi -o fcgiwrap

Here -L tells the linker where to find libfcgi at link time and -Wl,-R,<dir> embeds the runtime path; alternatively use LD_LIBRARY_PATH for testing or crle to alter system runtime paths permanently. After a successful link, verify dynamic links with ldd ./fcgiwrap.

Checklist: (1) find the lib, (2) ensure libfcgi.so (dev package) exists, (3) confirm CPU/bitness matches, (4) recompile with -L and -Wl,-R or set runtime path, (5) validate with ldd. This sequence fixes the vast majority of -lfcgi: not found cases on Solaris 10.

First check to see if you have a libfcgi install via any packages already:

grep libfcgi /var/sadm/install/conents

If grep finds anything you should try to use the command line option "-R" to set the runtime shared library path to the directory that contains the libfcgi.*so* shared library. See "man ld" for details on the "-R" option even though you need to pass "-R" to gcc since gcc runs ld for you.

If grep doesn't find anything you need to install a libfcgi. Possible source of this are:

1. the Sun Solaris 10 companion CD or DVD. Check the sun web sites that you get Solaris 10 from for this. It might also be available via Package name is SUNWfcgi

2. OpenCSW or Blastwave. Use a search engine to locate them. The package is CSWfastcgi and I'm inclined to believe that Blastwave has it but OpenCSW does not.

3. Sunfreeware see I don't know the package name if any.

4. source code

Even after installing libfcgi you will still need "-R" as above.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.