- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Deleting intermediate files and output files for project 'JesusP', configuration 'Release|Win32'.
Compiling...
ExampleUAM.cpp
ExampleModel.cpp
ExampleModel.cpp(1162) : warning C4244: 'initializing' : conversion from 'double' to 'const int', possible loss of data Compiling resources...
Linking...
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(winxfltr.obj) : error LNK2005: ___CppXcptFilter already defined in MSVCRT.lib(MSVCR71.dll)
LIBCMT.lib(crt0init.obj) : warning LNK4006: ___xc_z already defined in MSVCRT.lib(cinitexe.obj); second definition ignored
LIBCMT.lib(crt0init.obj) : warning LNK4006: ___xc_a already defined in MSVCRT.lib(cinitexe.obj); second definition ignored
LIBCMT.lib(crt0init.obj) : warning LNK4006: ___xi_z already defined in MSVCRT.lib(cinitexe.obj); second definition ignored
LIBCMT.lib(crt0init.obj) : warning LNK4006: ___xi_a already defined in MSVCRT.lib(cinitexe.obj); second definition ignored
LIBCMT.lib(winxfltr.obj) : warning LNK4006: ___CppXcptFilter already defined in MSVCRT.lib(MSVCR71.dll); second definition ignored
Creating library .\\Release/ExampleUAM.lib and object .\\Release/ExampleUAM.exp LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
libifcoremt.lib(for_main.obj) : error LNK2019: unresolved external symbol _MAIN__ referenced in function _main .\\Release/ExampleUAM.dll : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\\Simsci\\Dss45\\Dss45\\ExampleUAM\\Release\\BuildLog.htm"
JesusP - 7 error(s), 8 warning(s)
---------------------- Done ----------------------
Rebuild All: 0 succeeded, 1 failed, 0 skipped
***********************************************************
The C++ and Fortran Visual Studio settings are exactly the same as for my working example.
No of the .lib and variables quoted in the error messages exist in any of the C++ or Fortran code. I have not access to the Fortran code.
which do you think may be the causes of the errors, in particular the Linker 2005 error?. Any recommendations?
I am using Visual Studio .NET 2003 and Intel Fortran 10.1.
Thank you very much for your help in advance.
Regards
Jesusp
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
------
Wendy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The easiest solution is to change the Fortran project propert Libraries > Use Runtime Library to "Multithreaded DLL" in the Release configuration. In the Debug configuration you would want "Debug Multithreaded DLL". An alternative is to change the library type in the C++ project (under "Code Generation") to match the Fortran setting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
------
Wendy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, Wendy,
We have debugged the issue in the following way: As explained yesterday, we replaced the example Fortran code that was compiling correctly by the confidential Fortran code in the .f90 file so that we make sure that the Intel Fortran settings are the correct ones. In this case, the compilation of theconfidential Fortran code.lib with the C++ code still gave the errors reported (while the original example did not give these errors). Then, we disabled all the Fortran code except a minimum part and it compiled without errors. When we say compile, we refer to the compilation of the Fortran code to a .lib and then the compilation of the .lib with the C++ code). Then, we have enabled the code little by little and compiling (first the Fortran to .lib and then the -lib with the C++) until we have found the statements causing the trouble. The problem was caused by a STOP statement in a SUBROUTINE. Once this STOP instruction have been removed, the code compiled correctly in the C++.
We have also observed that implementing WRITE instructions in the Fortran code to extract results into a text file / DOS window produce the same type of errors.
Is it any way of allowing a Fortran code compiled as a .lib and then compiled/called with/from a C++ code to write directly into a text file / DOS display/... ?. We do not want to go through the Subroutine arguments to wirte on an output channel if possible. This is for debugging pruproses.
Regards
Jesus
Thanks for your kind support.
Regards
Jesus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page