Error in My Code: Undefined Symbols for x86_64

  • Thread starter Amany Gouda
  • Start date
  • Tags
    Code Error
In summary, the conversation is about a person receiving an error message while trying to run a code in gfortran on a MacBook Air. The error is related to undefined symbols for architecture x86_64 and the conversation also mentions issues with the installation of gfortran.
  • #1
Amany Gouda
29
0
I have received this error :
Fortran:
Undefined symbols for architecture x86_64:
"start", referenced from:

-u command line option

(maybe you meant: __gfortrani_library_start)

ld: symbol(s) not found for architecture x86_64

collect2: error: ld returned 1 exit status
what is this mean??

the code is :
Fortran:
program   exercise2

  integer:: i,j
  real,dimension (5,5)::A

  open(20,file='A.txt',status='old')  do i=1,5
  read(*,*)(a(i,j),j=1,5)
  end do

  do i=1,5
  write(20,*)(a(i,j),j=1,5)
  end do

close(20)

  end program exercise2
 
Last edited by a moderator:
Technology news on Phys.org
  • #3
jedishrfu said:
WHat command are you using to run the code?
I am using gfortran in macbook air version 10.9.5
 
  • #4
Amany Gouda said:
I am using gfortran in macbook air version 10.9.5
Could you show exactly the compiling command? The problem might be with your installation of gcc.
 
  • #5
DrClaude said:
compiling command

sigmat-no-air:desktop amany$gfortran exercise2.f90
 
  • #6
Then gfortran is not installed properly.
 

1. What does the error "Undefined Symbols for x86_64" mean?

This error is commonly seen in programming languages such as C or C++. It indicates that the compiler or linker is unable to find a definition for a symbol (variable, function, etc.) that is being used in your code. This can happen if the symbol is misspelled, not declared, or if there is an issue with the libraries being used.

2. How can I fix the "Undefined Symbols for x86_64" error?

To fix this error, you will need to check your code for any spelling errors or missing declarations. Make sure all necessary libraries are properly linked and included in your code. You may also need to ensure that the symbol is defined in a header file or in the same file where it is being used.

3. Why am I getting this error when my code was previously working?

This error can sometimes occur when making changes to your code or when switching to a different compiler or platform. It is possible that a symbol that was previously defined is now no longer recognized due to these changes. Double check your code and make sure all necessary declarations are present.

4. Can this error be caused by a missing or corrupt library?

Yes, a missing or corrupt library can also result in the "Undefined Symbols for x86_64" error. Make sure all necessary libraries are properly installed and linked in your code. If the issue persists, try reinstalling the library or using a different version.

5. Is there a way to prevent this error from occurring in the future?

To prevent this error, it is important to regularly check your code for any spelling errors or missing declarations. When using libraries, make sure they are properly installed and linked in your code. It may also be helpful to use a version control system to keep track of changes and revert back to a working version if needed.

Similar threads

  • Programming and Computer Science
Replies
4
Views
500
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
16
Views
5K
  • Programming and Computer Science
Replies
12
Views
1K
  • Programming and Computer Science
Replies
2
Views
172
  • Programming and Computer Science
Replies
5
Views
4K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
9
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
820
Back
Top