Linker errors with Fortran to C library - /usr/lib/libf2c.so: undefined reference to 'MAIN__'

后端 未结 3 1598
心在旅途
心在旅途 2021-01-21 05:08

So I\'m having a little trouble with the fortran to C library. Now, before I get into the problem, I can tell you that I cannot use g2c as some forum sites have suggested.

3条回答
  •  不知归路
    2021-01-21 05:55

    I know it's an old thread, but It was helpful for me when I faced the same problem.

    I solved it by applying the commands:

    sudo rm /usr/lib/libf2c.so && sudo ln -s /usr/lib/libf2c.a /usr/lib/libf2c.so

    as the OP did. I found the same trick here:

    http://byeworld.blogspot.com/2009/01/libf2cso-undefined-reference-to-main.html

    What it does is in fact is to delete the dynamic library and create an alias to the static library. The reason why it didn't work for the OP was that he/she didn't have the static library installed. That was clear from the output of the LOCATE command.

    I hope this helps someone else.

提交回复
热议问题