Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: Symbol cannot have a type

Status
Not open for further replies.

ema91

Technical User
Nov 26, 2015
8
GB
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
 
Which compiler are you using and what is the file extension? Builds fine on silverfrost as a .f90 program.
 
I use Force2.0 or codeblocks and I have the same problem. The extension is .f
 
Force 2.0 uses a very old F77 compiler which has been replaced by gfortran.

It works if you use gfortran or silverfrost.
 
Thank you!!!! I downloaded Silverfrost and now works! Thank you a lot, I was going crazy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top