Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Unable to have .lib compiled

Diego_S_2
Beginner
2,408 Views

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
Arjen_Markus
Honored Contributor I
1,137 Views

The error message is clear enough: you program requires a library called lib_aux_curve.lib. Is this library built as part of your entire program or is it an external library?

Since the error message includes a complete path, maybe the problem is that this particular library is not in that exact directory. If so, you should change the link options: if it is part of your project, remove this path+library name from the link option and instead update the project dependencies. For example:

  • You have two projects (with CVF 6A these were .dsp files), one for the main program "A" and one for a library "B".
  • You need to make sure that the library is built before the program. To do so you have to say via the dependencies for the main program that it depends on the library "B".

The same may apply to your program.

0 Kudos
Diego_S_2
Beginner
1,137 Views

There are one main Startup project that reference that Library

The reference is set correctly.

A require B 
 but B is not compiled (no one B.lib is found in debug folder...)   why ??   

Error    5    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\dll_regressione\LINK    dll_regressione

 

0 Kudos
Arjen_Markus
Honored Contributor I
1,137 Views

Impossible to say with any amount of accuracy or usefulness without seeing the projects :). But what happens if you only compile that library? Any error messages? Maybe it is stored in a different place than you expect?

0 Kudos
Diego_S_2
Beginner
1,137 Views

If I compile a project without link required It give me 

1>------ Rebuild All started: Project: Lib_aux_curve, Configuration: Debug Win32 ------
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

but in Debug folder these is no .lib  library  !!!!

So it is not found by other projects that need it !!

why ? 

0 Kudos
Steven_L_Intel1
Employee
1,137 Views

If what you report is exactly what the message says, you have a syntax error in the project property for additional libraries. Please attach a ZIP of the .vfproj file for your project and we'll take a look. I assume you have some version of Intel Parallel Studio XE with Intel Visual Fortran (you didn't say).

0 Kudos
Arjen_Markus
Honored Contributor I
1,137 Views

I can only guess and come up with the following possibilities:

  • There are no source files for this project
  • It is not a "library" project
  • The settings are such that the library is stored in a completely different location

Quite possibly there are other possibilities as well. But I would begin checking the project itself and the settings.

0 Kudos
Diego_S_2
Beginner
1,137 Views

Ok I .zip the project 

Steve can You give me a private email that I send to you the whole project ?

I have no  .vfproj file at all !!

0 Kudos
Diego_S_2
Beginner
1,137 Views

Example :

I send a single project zipped....

It does not gime me a .lib 

Can you have a look ?

0 Kudos
Steven_L_Intel1
Employee
1,137 Views

Well, that certainly explains things. This is a C++ project and won't compile Fortran source. Since this was a CVF project you need to right click on the C++ project and select "Extract Compaq Visual Fortran Project Items".  Read this article for more details.

0 Kudos
Diego_S_2
Beginner
1,137 Views

Ok,

I try to Extract all to Fortran Project and then Rebuild !!

The I give you a response ....

10 minutes please !!

0 Kudos
Diego_S_2
Beginner
1,137 Views

Many thanks 

Now it compile and give me a .lib  FINALLY !!!

But now the compiler give me other strange errors not in Fortran 6A 
like :

Error    2     error #5078: Unrecognized token 'report_unit?' skipped    C:\Users\RIDP425\Desktop\Ver_3.0.3.0_Marzo_2016\Fortran\prg\Lib_Gen\../inc/units.inc    105    
in          
common /report_unità/ unit_rev_rpm(max_unit),
     *       unit_qout(max_unit),
     *       unit_qpeso(max_unit),
     *       unit_ptt(max_unit)

OR

Error    4     error #5192: Lead underscore not allowed    C:\Users\RIDP425\Desktop\Ver_3.0.3.0_Marzo_2016\Fortran\prg\Lib_Gen\../inc/mf_units.inc    50    
in

      common /report_unità_2f/ unit2_rev_rpm(max_unit),
     *       unit2_qout(max_unit),
     *       unit2_qpeso(max_unit),
     *       unit2_ptt(max_unit),
     *       unit2_cons_su_qout(max_unit)

 

WHY ? THERE ARE NEW LANGUAGE DIRECTIVE or We can set Use OLD Fortran Language in settings
if there is such an option !!   ??????

I HABE SEEN in properties -> Fortran -> Language there are some options to set, may be there is one for old Fortran code ?

Thanks for your kind reply !!

 

0 Kudos
mecej4
Honored Contributor III
1,137 Views

The terms 'new' and 'old' are relative, and there are many people who consider Fortran-77 'new' and others who consider Fortran-90 'old'.

Your zip file in #9 does not contain the include file 'rk_param.inc'. It is difficult to check your code without knowing the declarations in that file.

0 Kudos
Diego_S_2
Beginner
1,137 Views

It seems that the new 2016 compiler not want   accented letters ...

If I change
    common /report_unità_2f/ unit2_rev_rpm(max_unit),
in

    common /report_unita_2f/ unit2_rev_rpm(max_unit),   (no accented letters !!!! )

it compile !!

 

0 Kudos
mecej4
Honored Contributor III
1,137 Views

The Fortran standard specifies the character set that may be used to create names:

3.2.2 Names
1 Names are used for various entities such as variables, program units, dummy arguments, named constants, and derived types.
R303 name is letter [ alphanumeric-character ] ...

Accent marks are not alphanumeric.

 

0 Kudos
Diego_S_2
Beginner
1,137 Views

OK MANY THANKS mecej4    !!!

0 Kudos
Steven_L_Intel1
Employee
1,137 Views

Compaq Visual Fortran did not accept such characters either.

0 Kudos
Diego_S_2
Beginner
1,137 Views

OK Thanks Guys...

  NOW I can continue to debug other errors going to new version !!

0 Kudos
Diego_S_2
Beginner
1,137 Views

NOW we have new ERRORS in Fortran coposer 2016 !!!

error lnk2005: __aligned_free already defined in LIBCMT.lib (align.obj) ???

ANY HELP ?

 

0 Kudos
Arjen_Markus
Honored Contributor I
1,137 Views

This kind of messages appears when you combine object files (or complete libraries) that have been compiled with compile options that associate them with different run-time libraries. You can either:

  • Fill in what standard libraries to ignore
  • Use a consistent set of compile options
  • Use the /force option to link the program

The latter is the easiest, but you have to accept that the linker will continue to produce these messages and tell you that "the image may not run". This has nothing to do with the Fortran compiler, but rather with the various sets of run-time libraries.

0 Kudos
Diego_S_2
Beginner
1,048 Views

Thanks,

 HOW CAN WE USE the /FORCE Option ?

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

0 Kudos
Reply