Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

error LNK2019 and fatal error LNK1120

camiel
Beginner
3,996 Views

Hi

I have a Fortran code and I use Visual Studio 2005 to run it.

Until today, it was working fine. I made some basicmodifications and now I have this two errors:

Error1 error LNK2019: unresolved external symbol _E referenced in function _MAIN__Modelos Lineales
Error2 fatal error LNK1120: 1 unresolved externalsModelos Lineales

I don't know what is the problem, please help me.

thanks

0 Kudos
5 Replies
Steven_L_Intel1
Employee
3,996 Views
The most common cause for this problem, based on your description, is that you have a reference such as:

X = E(3)

where you intend E to be an array but it is not declared as one, so the compiler thinks it's an external function. If this is the case, you need to declare E as an array. Sometimes, if you are using fixed-form source (.f or .for file type) and you add characters to a declaration, you can push things past column 72 and this can create puzzling errors.

Try adding IMPLICIT NONE or compile with /warn:decl and see if that shows you the problem.
0 Kudos
camiel
Beginner
3,996 Views

Thank you very much, Steve.

My program it's working now.

0 Kudos
shub
Beginner
3,996 Views

Hi Steve,

I am using Visual Studio 2008. I am getting similar errors after building my fortran code as camiel-

1>cjw.obj : error LNK2019: unresolved external symbol _UPSTRM referenced in function _MAIN__
1>Debug\cjwave.exe : fatal error LNK1120: 1 unresolved externals

In your last post, you suggested camiel to " compile with /warn:decl". Could you please tell how to implement that in VS 2008; Camiel was using VS 2005.

Thanks

0 Kudos
Steven_L_Intel1
Employee
3,996 Views

Right click on the project and select Properties. Go to Fortran > Diagnostics. Under Language Usage Warnings, set "Warn for Undeclared Symbols" to Yes.

This may result in many compile-time errors if you rely on implicit declarations. It also won't help if you CALL UPSTRM. I suggest you search your source to see what UPSTRM is supposed to be, and where it is used.

0 Kudos
shub
Beginner
3,996 Views

Thanks steve.

0 Kudos
Reply