We have an old Fortran 6A source code in Italy.
We have visual studio 2013 installed on windows server 2008 R2 64 bit.
But.. We cannot compile Fortran... no error.. no .lib if I biuld a project ... !!!!!!!
If I try to build the solution I get some errors like this one :
Error 6 error LNK1181: cannot open input file 'C:\Users\RIDP425\Desktop\Ver_22.214.171.124_Marzo_2016\Fortran\prg\Lib_aux_curve\Debug\Lib_aux_curve.lib' C:\Users\RIDP425\Desktop\Ver_126.96.36.199_Marzo_2016\Fortran\prg\main_analisi_statistica\LINK main_analisi_statistica
I explain ->
We purchased intel composer 2016 version 2 and installed on visual studio 2013 update 5 . We then loaded the solution with visual studio 2013 . When I compile a basic project gives no error and gives us the build complete message but under the Debug folder does not appear any librart.lib ... why? But If I try to build the solution I get the above list of errors "error LNK1181" ???? Why the project that biuild does not give us a .lib project ? Why we get some
LNK1181 errors ? ****** if I use compiler Command PROMPT 10.1 I get some errors (LNK2019 and LNK1120): libifcoremt.lib(for_main.obj) : error LNK2019: unresolved external symbol _MAIN_ _ referenced in function _main 77curve_aux_adi.exe : fatal error LNK1120: 1 unresolved externals Someone very nice give us a tip please !! Many thanks !!
/FORCE is not the right approach - at least not what you should look at first.
You have what we call "Mixed C Library Syndrome", where some of your code is built to use one set of libraries and another part is built to use a different set.
Assuming that your library project is going to be used by a Fortran main program, what I recommend is going in to the library project and setting the property Fortran > Libraries > Disable Default Library Search Rules to Yes. This will stop the library from referencing its own set of run-time libraries, relying on the executable project to do that. This works well for all-Fortran applications.
If there is some C/C++ in the application, then an alternative approach is to make sure that every project uses the same setting for its run-time libraries. In Fortran this is Libraries > Runtime Library. "Multithread DLL" (not Debug Multithread DLL) is the best choice for production applications. In C++ this selection is under Code Generation. All projects must use the same setting (DLL or non-DLL, Debug or non-Debug).
I INCLUDE THE PROJECT GIVING ERRORS !! Thanks ...
Error 2 error LNK2019: unresolved external symbol _MAX_POWER_NEW@160 referenced in function _DLL_MAX_POWER dll_accoppiamento.obj
Error 3 error LNK2019: unresolved external symbol _TRONCO@32 referenced in function _DLL_TRONCO dll_accoppiamento.obj
Error 4 fatal error LNK1120: 2 unresolved externals Debug/dll_accoppiamento.dll
There is only one Fortran source file in the zip file of #26. Within that source file there are calls to MAX_POWER_NEW() and TRONCO(). These are not routines in the Fortran runtime and we do not know what they are supposed to do. These are subprograms that you must provide, either in source form that you will compile and link with the caller(s) to build the DLL, or you must provide them in a library. A simple rule to follow: "Do not call subroutines or invoke functions that do not exist".
A static library can contain references to unsatisfied external symbols. These are resolved at link time. A DLL, on the other hand, must know where to find the code (either within itself or in other DLLs).
THIS CODE IS COMING FROM OLD CODE IN PROJECT C++/FORTRAN 6A
WE DON'T KNOW FORTRAN AT ALL.
MAKING CHANGES THAT ALL YOU GIVE US, THE SITUATION IS MORE FUNCTIONAL AND A LOT OF ERRORS HAVE GONE AWAY.
The subroutines TRONCO or MAX_POWER are defined in .for file with !DEC$ attribute export...
you can find them in the fortran .for file
maybe it is no more defined now ????
For the same project described above by Diego.S we have also this kind of error:
Error 551 general error c101008d: Failed to write the updated manifest to the resource of file "C:\Users\RIDP425\Desktop\Sire2000-Ver_188.8.131.52_Marzo_2016\Fortran\prg\main_dinamica\Release\main_dinamica.exe". The system cannot find the file specified. mt.exe
If somebody could help me I'll be very grateful :-)
Debora, that error means that the manifest tool (mt.exe) could not find your EXE. I have seen sometimes that antivirus tools will quarantine or delete newly-created EXE files as they think they are malware. I have found it useful to tell my antivirus program to not do automatic scanning of my project folders.
here the directory selected in the project properties - manifest tool
Output manifest file $(IntDir)\$(TargetName)$(TargetExt).embed.manifest
here the one selected to projec properties-linker-manifest file
You overrode the default output file name in the Linker property to be Debug/dinamica.exe but the project's target file property is the default $(TargetName) which is main_dinamica (the .exe is then applied). This is why the manifest tool can't open the EXE.
You should generally not change the name of the output file in the linker property - use the project's target file name property instead.
I don't know what you changed. I suggest you do this.
Open the project properties. In the Configuration dropdown select "All configurations".
On the General page, change the Target Name property to "dinamica".
Next go to Linker > Output file. It will show as blank. Click the down-triangle to the right and select "<Inherit from project defaults>".
Click OK. Now do a Build > Rebuild.