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

undefined reference to `MAIN__'

bredsj
Novice
1 001 Visites

I have just converted to Linux from the Windows platform, running Ubuntu 8.10 64 bit version. I use Intel Fortran ver 11, also the 64 bit version.

I get the following message when compiling:

ifort -O2 -i8 -r8 -assume byterecl insap_globals.for
/opt/intel/Compiler/11.0/074/lib/intel64/for_main.o: In function `main':
/export/users/nbtester/efi2linux_nightly/branch-11_0/20081106_010000/libdev/frtl/src/libfor/for_main.c:(.text+0x38): undefined reference to `MAIN__'

Any reason why this message pops up?

Thanks in advance.

0 Compliments
2 Réponses
Steven_L_Intel1
Employé
1 001 Visites

I would guess that insap_globals.for is not a complete program - perhaps it is a module or a BLOCK DATA subprogram. The error is saying that there is no main program in the compilation.

If you are compiling several sources separately and then linking them, add the switch -c to the compile lines (but not the link line.)

0 Compliments
bredsj
Novice
1 001 Visites


Thanks Steve, got it.

0 Compliments
Répondre