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

后端 未结 3 1681
心在旅途
心在旅途 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:54

    You should have paid closer attention to the first error message. The linker is telling you that no symbol MAIN__ can be found, which is what f2c is expected that the fortran main will be compiled to in your C or C++ code somewhere. The f2c library itself was working just fine.

    The solution to the original error would be to make sure the correct entry point is defined in your code. It might be that by using C++ to compile, you have name mangling problems and the correct entry point for the f2c library doesn't exist.

    Now by messing around with the f2c libraries, you have totally broken your f2c installation. Reinstall it and start again...

提交回复
热议问题