Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

IntelC++ Compiler V8.0 - Link error

vimalvinayan
Beginner
323 Views
> icc -o -fast *.cpp
NLMG.h
NRUTIL.cpp -> NRUTIL.o
NLMG.cpp -> NLMG.o
NRUTIL.h

The compiler creates the *.o files without any problems.

>icc -o roll_icc NRUTIL.o NLMG.o -lm

Getting this error when I try to link all the *.o files

/usr/lib/crt1.o(.text+0x18): In function `_start':
../sysdeps/i386/elf/start.S:77: undefined reference to `main'

Platform : SUSE Linux (Opteron)

Thanks
0 Kudos
3 Replies
JenniferJ
Moderator
323 Views
Make sure you've run the script "iccvars.sh" to set up the necessary build environment before using the "icc".
Jennifer
0 Kudos
TimP
Honored Contributor III
323 Views
I don't remember exactly when the change was made, but icpc is the command currently intended for linking C++.

If you run nm on the .o file you make when compiling the main() function (with -c, but without the -fast option), the main symbol should show there. Your link message says no main() function is found.

Message Edited by tim18 on 08-09-2005 02:24 PM

0 Kudos
vimal_vinayan
Beginner
323 Views
Thanks Jennifer and Tim
I was able to download Version 9.0 of the Intel C++ compiler. Didn't have any problems with it.
Vimal
0 Kudos
Reply