Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Linking Fortran routine to C code


Please bare with me as I am new to VS. I am using the most recent Parallel Studio XE with the most recent C++ and Visual Fortran 12 composers with Windows 7

I am trying to make an algoritm written in C call a Fortran simulation model. The solution file for the simulation model has been provided to me and I added a C project to it with the associate dependancies. I am familiar with most of the nuances when trying to communicate b/w the two languages but I receive an error at the end of the build process as follows:

3>ipo : warning #11021: unresolved swt_v4_
3> Referenced in ipo_76685obj.obj
3>ipo : error #11023: Not all components required for linking are present on command line
3> xilink: executing 'link'
3>ipo_76685obj.obj : error LNK2019: unresolved external symbol swt_v4_ referenced in function func
3>: fatal error LNK1120: 1 unresolved externals

swt_v4_ is the Fortran program that I converted to a subroutine within the C code.

One thing that is concerning me is that under the property pages for the swt_v4 simulation, the configuration type still says application (which was the original intention), but now I just need it to be a routine and the C project to be the application. I am not sure how to specify this within the project properties.

I also get these errors and I don't really understand how to manage libraries:

2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: calloc already defined in LIBCMT.lib(calloc.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: free already defined in LIBCMT.lib(free.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: printf already defined in LIBCMT.lib(printf.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: rand already defined in LIBCMT.lib(rand.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: srand already defined in LIBCMT.lib(rand.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: fprintf already defined in LIBCMT.lib(fprintf.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: fflush already defined in LIBCMT.lib(fflush.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: fwrite already defined in LIBCMT.lib(fwrite.obj)
2>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
2>gmg.lib(SOLVERS.obj) : error LNK2019: unresolved external symbol resprint referenced in function PCG_eval
2>libifcoremt.lib(for_main.obj) : error LNK2019: unresolved external symbol MAIN__ referenced in function main
2>x64\\Release/swt_v4x64.exe : fatal error LNK1120: 2 unresolved externals

Please let me know what other information you might need in order to help with this issue.


0 Kudos
1 Reply
Sorry for the double post.

The issue is currently being discussed here:
0 Kudos