Here is a hunch. You are a graduate student in science or technology (but not computer science or computer engineering), and your boss was born before 1950. If so, I stood on your shoes (except that in my case it was necessary to use Fortran 77), I feel your pain.
As you probably know, Fortran does not use header files for prototyping function calls in the same way as C. You can call a Fortran function without a header if the argument types are not marked.
However, there is this problem - or once there was this problem, since my most recent experience is an outdated year. Compared to C, GNU Fortran adds hidden underscore to the name of each function. It also shortens the name of the function.
The readelf -a
program can help you here. Use it in the object file that the Fortran compiler emits. Look at the output for the socket
symbol. If my memory is correct, you will see _socket
there.
If you really really can't use any C at all - even to create a wrapper function called C _socket()
, then I admit that I don't know what you should do next. In this case, you may be stuck in a bottleneck. In any case, good luck.
Update: I recommend @MSB comment below.
source share