title: Fortran derived type constructor defined though C function (II)
body: <p>Following question <a href="https://stackoverflow.com/questions/41271552/fortran-derived-type-constructor-defined-though-c-function">Fortran derived type constructor defined though C function</a>, I came up to this non working example, with gfortran 4.9:</p>
  
  <pre><code>module my_module
    use iso_c_binding
    type, bind(c) :: my_double
       real(c_double) :: x
       real(c_double) :: y
    end type my_double
    interface my_double
        procedure my_module_fortran_new_my_double
    end interface
    interface
       type(my_double) function my_module_fortran_new_my_double (v) bind ( c )
         use iso_c_binding
         import :: my_double
         real (c_double), intent(in) :: v
       end function my_module_fortran_new_my_double
    end interface
  end module my_module
  
  program main
    use my_module
    type(my_double) x
    x = my_double(12)
  end program main
  </code></pre>
  
  <p>Following the previous question <a href="https://stackoverflow.com/questions/41271552/fortran-derived-type-constructor-defined-though-c-function">Fortran derived type constructor defined though C function</a>, the module defintion works fine. However, the defined constructor is not recognized by my compiler.</p>
  
  <p>Here is the compiler output:</p>
  
  <pre><code>$ gfortran -std=f2008 test.f90 -o test.o -c
  test.f90:22.6:
  
    x = my_double(12)
        1
  Error: No initializer for component 'y' given in the structure constructor at (1)!
  </code></pre>
  
  <p>This does seem that my used defined constructor is not taken into account. Could someone help me understanding what I have done wrong (again) ?</p>