Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22162

Static linking of Fortran program with some C routines

$
0
0

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?


Viewing all articles
Browse latest Browse all 22162

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>