INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Error: Symbol cannot have a type

Error: Symbol cannot have a type

(OP)
Hi! I'm new here and a few days ago I have started to program in Fortran. I used Fortran 5 years ago in my university but now I have a problem. I use codebloks and when I compile this text I have this error: Symbol 'Square' cannot have a type. I don't understand why? There is anyone can help me?
This is the code:
program square_2
implicit none

integer :: i
integer, dimension (-5:5) :: number, square
do i= -5, 5
number(i) = i !Initialize number
square(i) = number(i)**2 !Calculate square
end do

do i= -5, 5
write (*,100) number(i), square(i)
100 format (1X, 'Number = ', I6, ' Square = ', I6)
end do

pause
end program square_2

RE: Error: Symbol cannot have a type

Which compiler are you using and what is the file extension? Builds fine on silverfrost as a .f90 program.

RE: Error: Symbol cannot have a type

(OP)
I use Force2.0 or codeblocks and I have the same problem. The extension is .f

RE: Error: Symbol cannot have a type

Force 2.0 uses a very old F77 compiler which has been replaced by gfortran.

It works if you use gfortran or silverfrost.

RE: Error: Symbol cannot have a type

(OP)
Thank you!!!! I downloaded Silverfrost and now works! Thank you a lot, I was going crazy.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close