# Ccall TypeError

**URL:** <https://discourse.julialang.org/t/ccall-typeerror/8518>\
**Category:** Internals & Design\
**Created:** [January 22, 2018, 10:30am UTC](https://discourse.julialang.org/t/ccall-typeerror/8518 "2018-01-22T10:30:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [January 22, 2018, 10:30am UTC](https://discourse.julialang.org/t/ccall-typeerror/8518/1 "2018-01-22T10:30:11Z")

</div>

The following function gives an error in 0.7.0-DEV.3507 when declared in a module:

```julia
function version()
  info = ccall( (:gr_version, "/usr/local/gr/lib/libGR.so"),
               Cstring,
               (),
               )
  unsafe_string(info)
end

```

Example:

```julia
julia> using GR

julia> version()
ERROR: TypeError: in version, in ccall: first argument not a pointer or valid constant expression, expected Ptr, got Tuple{Symbol,String}
Stacktrace:
 [1] version() at /usr/local/lib/julia/v0.7/GR/src/GR.jl:3350
 [2] top-level scope

julia> which(:version)
GR

```

Works fine in the REPL !? Any idea?
