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

What does this Fortran Compiler Error mean?

StrugglingGradStudent
488 Views

Hey,

I'm brand new to fortran. For starters, I did not write the code I am trying to compile. I'm trying to use an fparser that I downloaded from source code. Whenever I try to compile the program, I get this error message:

Undefined symbols for architecture x86_64:
"_MAIN__", referenced from:
_main in for_main.o
ld: symbol(s) not found for architecture x86_64

 

I am unsure of what this means, and what I can do to solve the problem. From my google searches, it sounded like it was an issues with 32bit and 64bit compatibility, but when I ran the compiler with the "ia32" option, I still had the same error. I tried running the compiler both on Windows 11 and MacOS Monterrey with no luck. Does anyone know what I should do?

 

Also, where should I look in the future to solve an issue like this myself?

 

Thank you for helping a struggling grad student! Please be kind. I'm very new.

0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
458 Views

The error message says that you asked to build a complete program, but what you supplied were only callable procedures, not a main program to use the procedures (subroutines or functions).  I don't know if this parser is meant to be a standalone program. Perhaps there are multiple source files you have to build together to form a complete program.

Andrew's advice I think is the wrong direction, as the messages you list indicate that it did try to build a console program.

View solution in original post

3 Replies
andrew_4619
Honored Contributor II
480 Views

You possibly have the wrong project type in the settings.  If you have a "PROGRAM" statement for a main program it will be a console project type.

0 Kudos
Steve_Lionel
Honored Contributor III
459 Views

The error message says that you asked to build a complete program, but what you supplied were only callable procedures, not a main program to use the procedures (subroutines or functions).  I don't know if this parser is meant to be a standalone program. Perhaps there are multiple source files you have to build together to form a complete program.

Andrew's advice I think is the wrong direction, as the messages you list indicate that it did try to build a console program.

StrugglingGradStudent
449 Views

Hey All! I have the program up and running now. I can't thank both of you enough. I just needed to link the parser file to the program file during compiling. I clearly have a lot more to learn

Reply