Linking FORTRAN and C++ objects files

假如想象 提交于 2019-12-08 01:54:28

You should find file libgfortran.* (e.g. with locate of find / -name "libgfortran.*"; or in windows-way Win+g, F3 or any file manager), record the path where it is and do

 g++ mlp8.o mean_cpp.o -o main -LPATH_RECORDED –lgfortran

where PATH_RECORDED is the path.

Try this lib list (got it from my mingw gfortran with -v option)

 g++ mlp8.o mean_cpp.o -o main -LPATH_RECORDED –lgfortran -lmingw32 -lgcc_s -lgcc -lmoldname  -lmingwex -lmsvcrt
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!