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

compiling problem (I'm new in Mac

ccors
Beginner
750 Views
hello
I'm new in Mac. I installed a demo version of Intel Fortran Compiler in mac os X leopard, I can't compile any program, not even the most simple:

program test
write(*,*) 'hello world'
end program

and the compiler shows this error:

ld: duplicate symbol _main in /Users/carloscorsi/Desktop/propedeutico/programacion/mar 26-05/ejercicio14/build/ejercicio14.build/Debug/ejercicio14.build/Objects-normal/i386/main.o and /opt/intel/Compiler/11.0/059/lib/for_main.o

could you please tell me how can I solve it?

thank you
0 Kudos
6 Replies
Ron_Green
Moderator
750 Views
Quoting - ccors
hello
I'm new in Mac. I installed a demo version of Intel Fortran Compiler in mac os X leopard, I can't compile any program, not even the most simple:

program test
write(*,*) 'hello world'
end program

and the compiler shows this error:

ld: duplicate symbol _main in /Users/carloscorsi/Desktop/propedeutico/programacion/mar 26-05/ejercicio14/build/ejercicio14.build/Debug/ejercicio14.build/Objects-normal/i386/main.o and /opt/intel/Compiler/11.0/059/lib/for_main.o

could you please tell me how can I solve it?

thank you

strange one. So you compile with:

ifort -o test test.f90

? How are you compiling and linking the program?
0 Kudos
TimP
Honored Contributor III
750 Views

strange one. So you compile with:

ifort -o test test.f90

? How are you compiling and linking the program?
This is a common FAQ. As most Unix-like systems have a built-in "test" command, attempting to overload that name for your own unrelated purpose isn't recommended. This isn't the reason for your linker problem. When you get to running, you would be depending on your shell distinguishing "test" from "./test" et al.
0 Kudos
ccors
Beginner
750 Views
Quoting - tim18
This is a common FAQ. As most Unix-like systems have a built-in "test" command, attempting to overload that name for your own unrelated purpose isn't recommended. This wouldn't necessarily explain a linker problem. When you get to running, you would be depending on your shell distinguishing "test" from "./test" et al.

I use Xcode to program and then clik "Build", I don't use the Terminal
0 Kudos
Ron_Green
Moderator
750 Views
Quoting - ccors

I use Xcode to program and then clik "Build", I don't use the Terminal

did you read the section in the documentation, the User's Guide, chapter "Building Applications with the XCode IDE"?

Documenation in /opt/intel/Compiler/11.0/053/Documentation/compiler_f/compiler_documentation_f.htm

Open in Safari or Firefox and navigate to that chapter, it's under 'User Guide' -> 'Building Applications'

It sounds like you either have 2 main programs in the sources for the project OR somehow you have a main.c source added to the project.

ron
0 Kudos
Kevin_D_Intel
Employee
750 Views


You can try obtaining the Xcode Hello sample I provided under an earlier thread at:
http://software.intel.com/en-us/forums/showpost.php?p=76240

0 Kudos
ccors
Beginner
750 Views
ok!
now it works!
thank you fortran masters!!
0 Kudos
Reply