I have a Fortran program with two small C routines for I/O. I use GCC to compile and link this on Windows, Linux and MacOS (well, on Catalina I need to use Mac's own C compiler) and it works.
Now I wanted to link this program using -static
to run the program on a computer which does not have the Fortran libraries. This worked on Windows but on Linux the linker failed stating -lm -lc missing
. On MacOS it failed complained -lcro0.o missing
.
The whole program is available at opencalphad repository at github including a Makefile, the only thing needed to modify is to add "-static" in the line for linking. Without -static it works.
Any suggestion what can be done?