Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
42 Views

Unable to have .lib compiled

Hi !!

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_3.0.3.0_Marzo_2016\Fortran\prg\Lib_aux_curve\Debug\Lib_aux_curve.lib'    C:\Users\RIDP425\Desktop\Ver_3.0.3.0_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 !!
0 Kudos
50 Replies
Highlighted
Beginner
16 Views

Thanks,

 HOW CAN WE USE the /FORCE Option ?

 HOW CAN WE SET the /FORCE Option in Visual Studio 2013 ?

0 Kudos
Highlighted
Valued Contributor II
16 Views

You specify it in the properties for the link step - select the project and right-click.

0 Kudos
Highlighted
16 Views

/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).

Retired 12/31/2016
0 Kudos
Highlighted
Beginner
16 Views

WOW !!! thanks 

ANOTHER kilos of beautiful errors now :

 error LNK2019: unresolved external symbol
 error LNK1120: unresolved externals

 SOME KINDLY HELP ?

 

0 Kudos
Highlighted
16 Views

If you could show a few examples of what the missing externals look like, we might be able to help.

                    --Lorri

0 Kudos
Highlighted
Beginner
16 Views

YES

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    

 

 

0 Kudos
Highlighted
Black Belt
16 Views

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).

0 Kudos
Highlighted
Beginner
16 Views

 

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 ????

 

0 Kudos
Highlighted
Beginner
16 Views

 IT NEED A LINKED LIBRARY ? 

   OK FANTATIC WE HAVE DONE !!  THANKS    ##########

  

0 Kudos
Highlighted
Beginner
16 Views

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_3.0.3.0_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 :-)

thx

0 Kudos
Highlighted
16 Views

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.

Retired 12/31/2016
0 Kudos
Highlighted
Beginner
16 Views

I stopped my antivirus but nothing changed. I don't know ... thanks so much.

If somebody could give me an idea :)

thx and regards

0 Kudos
Highlighted
16 Views

First, does the EXE exist in that location by that name? You may have changed Linker output property to put it somewhere else.

Retired 12/31/2016
0 Kudos
Highlighted
Beginner
16 Views

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

$(IntDir)\$(TargetName)$(TargetExt).intermediate.manifest

0 Kudos
Highlighted
16 Views

Neither of those is the relevant property. Please ZIP the .vfproj file and attach it to a reply here. It would also be helpful to include the buildlog.htm

Retired 12/31/2016
0 Kudos
Highlighted
Beginner
16 Views

here the .zip you asked! thx for your help!

hoping for a solution as soon.

0 Kudos
Highlighted
16 Views

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.

Retired 12/31/2016
0 Kudos
Highlighted
Beginner
16 Views

I try to change but nothing changes in my output.. the error is there!

0 Kudos
Highlighted
16 Views

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.

Retired 12/31/2016
0 Kudos
Highlighted
Beginner
16 Views

ok thanks a lot! now when I set at compiling in Relese I've no errors...just the same errors before when I set debug before compiling

0 Kudos