I am trying to compare the results of a C++ hash function with the Fortran translation of that function. I therefore want to link the Fortran function, a Fortran driver, the original C++ code, and an “Extern C” wrapper for the C++ code. I do my work on a MacBook Pro, that runs an Intel processor, under MacOS 11.6. I’m attempting to use GNU Fortran (
gfortran) and GNU C++ (
g++), as installed using Mac Ports. The installed compilers don’t know the location of the system include files or libraries, so I am manually providing links to the directories with the link command. Everything now goes well until the link command where I get
...% make -f Makefile.validation gfortran -O3 -I../../mod_files -J./mod_files -L../../ -L./ -L/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/ \ test_64_bit_hash_validation.o \ spooky_wrapper.o \ -lfortran_stdlib -lc_hash \ -o test_64_bit_hash_validation - gfortran: error: -E or -x required when input is from standard input
As near as I can tell the reported error
gfortran: error: -E or -x required when input is from standard input implies that “gfortran” thinks I am asking for the compilation of code being input through
stdin, e.g., I am piping the source code to the command line . This leads to the following questions:
- Is there a better forum for this problem?
- Is my interpretation of the message correct?
- What am I doing wrong?
- How do I fix the problem?