# Calling fortran function

**URL:** https://discourse.julialang.org/t/calling-fortran-function/2288
**Category:** New to Julia
**Tags:** ccall, fortran
**Created:** [February 24, 2017, 9:59pm UTC](https://discourse.julialang.org/t/calling-fortran-function/2288 "2017-02-24T21:59:08Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![simonbyrne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonbyrne/32/19_2.png) [@simonbyrne](https://discourse.julialang.org/u/simonbyrne)
#### Post date: [February 25, 2017, 2:05am UTC](https://discourse.julialang.org/t/calling-fortran-function/2288/8 "2017-02-25T02:05:03Z")

</div>

You should pass arrays as `Ref{T}` where `T` is the element type. `Array` should basically never appear in a ccall signature, as it is a Julia object (and no C libraries that I know of expect to be passed Julia arrays).

i.e. try:

```julia
ccall(("sqrinr_","qrupdate-1.1.2/libqrupdate"), Void, 
    (Ref{Int64}, Ref{Int64}, Ref{Float64}, Ref{Int64}, Ref{Float64}, Ref{Int64}, Ref{Int64}
, Ref{Float64}, Ref{Float64}), 
    n, q, Q, n+1, R, n+1, n, xp, w)

```

---

_[View the full topic](https://discourse.julialang.org/t/calling-fortran-function/2288)._
