<div dir="ltr"><div>Hi,</div><div><br></div>I have a C++ project with two subprojects written in Fortran, sub1 and sub2. To be able to build them on Windows with MinGW's gfortran, the subprojects are added to the main project with cmake_add_fortran_subdirectory as described in <a href="http://www.kitware.com/blog/home/post/231">http://www.kitware.com/blog/home/post/231</a>. Moreover, sub2 calls functions defined in sub1, so I link sub1 to sub2 using the following cmake command:<div>
<br></div><div> target_link_libraries(sub2 sub1)</div><div><br></div><div>This woks fine on Linux but when I try to compile the project on Windows with Visual C++ and gfortran I get the following error:</div><div><br></div>
<div> ld.exe: cannot find -lsub1</div><div><br></div><div>Is there a way to link the library from another Fortran project so that it worked on Windows with gfortran & VC++ too?</div><div><br></div><div>Thanks,</div>
<div>
Victor</div></div>