crt1.o undefined reference error

crt1.o undefined reference error

I'm running a stock version of Redhat linux 7.3 on a pIII with IFC 7.0.

when I invoke ifc from the command line I receive:

[root@lithium bsd]# ifc -V
Intel Fortran Compiler for 32-bit applications, Version 7.0 Build 20021028Z
Copyright (C) 1985-2002 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY

GNU ld version 2.11.93.0.2 20020207
Supported emulations:
elf_i386
i386linux
elf_i386_glibc21
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'

Has anyone seen this before?

Thanks,

Louis

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

This appears to be normal behavior of ld when you don't supply a Fortran main program, either in source or object form, or a C main() or equivalent. C run-time is looking to link to your main() program, and you haven't supplied one. Since the diagnosis comes from ld, the GNU linker, the wording is not under the control of the compiler.
It is conceivable that some other compilers might diagnose this, for your example, e.g. "no files specified."

> This appears to be normal behavior of ld when you
> don't supply a Fortran main program, either in source
> or object form, or a C main() or equivalent. C
> run-time is looking to link to your main() program,
> and you haven't supplied one. Since the diagnosis
> comes from ld, the GNU linker, the wording is not
> under the control of the compiler.
> It is conceivable that some other compilers might
> diagnose this, for your example, e.g. "no files
> specified."

Thanks for your comment, Timothy.

I had a same problem with v.7.1 build 20030402Z on Redhat 9.0 with Redhat 8.0 glibc (2.2.93).

Once I specify a source code, it's working fine now.

Justin

Hi, Timothy!

Yes, its the message ld sends, when ld is invoked without any file containing main().

But sorry, this is not what I would expect. Invoking the compiler without any Fortran file should give me some hint like "Usage: ifc [options] files ...", as ifc 6.0 and other compilers do. There is not reason to invoke ld when ifc got no input. Seems for me like a bug!

That's the expected response, when ifc tries to link, and you haven't provided a main program, either in source or .o form.

Leave a Comment

Please sign in to add a comment. Not a member? Join today