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

Undefined symbols: _MAIN__ errors on compiling

ealaag
Beginner
370 Views
Running latest ifort on a Mac OS 10.5.8 system.

I am compiling some codes originally written on a linux system running IFC 8. The codes compiled with no errors before. 90 percent of them still compile with no errors. However, some of them are failing to compile with this strange error:

I compile this way:
> ifort -save -o xnfpelsyn.exe xnfpelsyn.for

and I get this:

Undefined symbols:
"_kapp_", referenced from:
_MAIN__ in ifort55JEAd.o
"_readin_", referenced from:
_MAIN__ in ifort55JEAd.o
"_freeff_", referenced from:
_MAIN__ in ifort55JEAd.o
_MAIN__ in ifort55JEAd.o
_xfreef_ in ifort55JEAd.o
_xfreef_ in ifort55JEAd.o
"_pops_", referenced from:
_MAIN__ in ifort55JEAd.o
_MAIN__ in ifort55JEAd.o
_MAIN__ in ifort55JEAd.o
_MAIN__ in ifort55JEAd.o
ld: symbol(s) not found

What would be a typical cause for this failure? I already searched through the forums. I found a few people who had this problem, but their solutions do not seem to apply in my case.

Thanks!

0 Kudos
1 Reply
mecej4
Honored Contributor III
370 Views
You may have misinterpreted the error messages from the linker. It is not MAIN that is undefined, but symbols

kapp
readin
freeff
pops

that are called/referenced from MAIN, etc.

If you do not think that these are routine names, check for missing array declarations for variables with these names.
0 Kudos
Reply