Fortran - libmingw32.a, undefined reference to winmain

 
Vista:
sin imagen de perfil

libmingw32.a, undefined reference to winmain

Publicado por ALEX.1968 (4 intervenciones) el 01/01/2016 14:29:23
He escrito un modulo en Fortran que no me da errores de compilacion pero cuando intento construir me dice:
libmingw32.a, undefined reference to winmain

Alguien me podría orientar sobre cual es el problema.

Gracias.

MODULO:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
module resuelve_sudoku
implicit none
integer,parameter::z=9
integer::matrizpunteo(z,z,z)
 
 
contains
 
subroutine punteo(matrizpunteo,sudoku)                           !1ª Subrutina: creacioón de la matriz punteo y asignación de valores
 
 implicit none
    integer,intent(inout)::matrizpunteo(z,z,z),sudoku(z,z)
 
    integer::i,j
 
    matrizpunteo=0
    do i=1,z
     do j=1,z
         if(sudoku(i,j)==0) then
             matrizpunteo(i,j,:)=1
   end if
  end do
    end do
 
 
end subroutine
 
 
subroutine escaneo(matrizpunteo,sudokuscan)                             !2ª Subrutina: fase de escaneo(filas,columnas,submatriz)
 
 implicit none
    integer,intent(inout)::matrizpunteo(z,z,z),sudokuscan(z,z)
 
    integer::i,j
 
 
 
 do i=1,z
     do j=1,z
         if(sudokuscan(i,j)==0) then
             cycle
   end if
 
            where(matrizpunteo(i,:,sudokuscan(i,j))==1)                                 !Escaneo de las filas
             matrizpunteo(i,:,sudokuscan(i,j))=0
   end where
 
   where(matrizpunteo(:,j,sudokuscan(i,j))==1)                                  !Escaneo de las columnas
             matrizpunteo(:,j,sudokuscan(i,j))=0
   end where
 
   where(matrizpunteo(((i-1)/3)*3+1:((i-1)/3)*3+3,((j-1)/3)*3+1:((j-1)/3)*3+3,sudokuscan(i,j))==1)   !Escaneo de la submatriz
    matrizpunteo(((i-1)/3)*3+1:((i-1)/3)*3+3,((j-1)/3)*3+1:((j-1)/3)*3+3,sudokuscan(i,j))=0
   end where
     end do
 end do
 end subroutine
 
 
 
 subroutine resultado(matrizpunteo,sudokuscan)                                       !3ª Subrutina: Resultado
 
 implicit none
    integer,intent(inout)::matrizpunteo(z,z,z),sudokuscan(z,z)
 
    integer::pos,cont,i,j,K
    sudokuscan=0
 do i=1,z
     do j=1,z
      cont=0
   do k=1,z
             if(matrizpunteo(i,j,k)/=0) then
    cont=cont+1
                pos=k
    end if
   end do
            if(cont==1) then
               sudokuscan(i,j)=pos
            end if
  end do
 end do
 
    write(*,*) 'Esta es la matriz sudokuscan:'
    write(*,*) '-----------------------------------------'
    do i=1,9
     write(*,'(x,9(i3))') sudokuscan(i,:)
 
      write(*,*) " +-------+--------+--------+"
 
 
    end do
 
    write(*,*)
 
    read(*,*)
 
end subroutine
 
 
end module
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

libmingw32.a, undefined reference to winmain

Publicado por Capitan Kirk (19 intervenciones) el 12/01/2016 22:37:02
Entiendo que lo que has hecho, entonces, es compilar e intentar enlazar ese módulo que has posteado. El error que te da es del enlazador (linker) y se debe a que no encuentra un punto de entrada al programa, ya que en ese módulo NO TIENES programa principal. Ese módulo tendrás que compilarlo junto con otro u otros, en donde sí tengas un programa principal que llame a las funciones que has implementado en el módulo.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar