Question

I'm not a linux expert but I'm running into the following problem which I hope to get solved here. My system has gcc 4.4 and I had to install an older version of gcc (gcc 4.2) on my home space so I can build a simulation tool.

Anyway, everything went well and I was able to build the tool. However, when I now try to link statically using '-static' gcc option I get errors such as:

/usr/local/bin/ld: cannot find -lm
/usr/local/bin/ld: cannot find -lc

collect2: ld returned 1 exit status

I installed the dev package for glibc using (assuming the static version of the libraries will be installed)

$ yum install glibc-devel glibc-static

But I still get the errors. I don't know where to go from here.

By the way, I added the local version of gcc (ie gcc 4.2) to PATH and the libs to the LD_LIBRARY_PATH and LIBRARY_PATH.

Do I need to get glibc and install it locally too, if so which version should I get?

Thanks

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top