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

Error LNK2019 external symbol system@8_

Andrade__Gabriel
Beginner
313 Views
Good afternoon. I am trying to run an EXE external file with the command RESULT = SYSTEM('programa.exe') but the code is returning the code: error LNK2019: unresolved external symbol _SYSTEM@8 referenced in function _MODELO Modelo.obj I looked up some solutions but I couldn't find anything usefull.
0 Kudos
2 Replies
andrew_4619
Honored Contributor II
313 Views

System is not standard Fortran but it is defined in the module IFPORT so add USE IFPORT to your source. Better still use EXECUTE_COMMAND_LINE  which is standard fortran,

0 Kudos
Steve_Lionel
Honored Contributor III
313 Views

The @8 indicates that you have asked the compiler to use the STDCALL calling convention, possibly as a result of migrating the application from Compaq Visual Fortran or using the /iface compiler option. Right click on the project, select Properties. Go to Fortran > External Procedures. Change Calling Convention to "Default" and String Length Argument Passing to "After all arguments".

I do agree with Andrew's recommendation of the standard intrinsic EXECUTE_COMMAND_LINE instead of SYSTEM.

0 Kudos
Reply