Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no method matching argtype(::CLUnexposed, ::Int64) #239

Closed
IanButterworth opened this issue Oct 27, 2019 · 4 comments
Closed

no method matching argtype(::CLUnexposed, ::Int64) #239

IanButterworth opened this issue Oct 27, 2019 · 4 comments

Comments

@IanButterworth
Copy link
Member

I'm trying to wrap libpng (self-contained jll-based wrap code here) and I'm hitting:

ERROR: LoadError: MethodError: no method matching argtype(::CLUnexposed, ::Int64)
Closest candidates are:
  argtype(::Union{CLFunctionNoProto, CLFunctionProto}, ::Integer) at /Users/ian/.julia/packages/Clang/CiPzM/src/type.jl:137
Stacktrace:
 [1] (::Clang.var"#25#27"{CLUnexposed})(::Int64) at ./none:0
 [2] iterate at ./generator.jl:47 [inlined]
 [3] collect(::Base.Generator{UnitRange{Int64},Clang.var"#25#27"{CLUnexposed}}) at ./array.jl:620
 [4] wrap!(::DefaultContext, ::CLFunctionDecl) at /Users/ian/.julia/packages/Clang/CiPzM/src/wrap_c.jl:22
 [5] run(::WrapContext, ::Bool) at /Users/ian/.julia/packages/Clang/CiPzM/src/compat.jl:122
 [6] run(::WrapContext) at /Users/ian/.julia/packages/Clang/CiPzM/src/compat.jl:89
 [7] top-level scope at /Users/ian/.julia/dev/ImageIO/gen/libpng/wrap_libpng.jl:25
@Gnimuc
Copy link
Member

Gnimuc commented Oct 28, 2019

only functions have argument types. that error basically means libclang failed to directly recognize the function prototype, so a CLUnexposed cursor was returned. More subroutines need to be added to extract the function prototype from the CLUnexposed cursor. Could you share the link to the libpng header?

@IanButterworth
Copy link
Member Author

I won’t be able to share the headers until tomorrow, but the wrap script installs the jll, then links to the headers in the artifact, so that should work in 1.3+

I’ll add the headers as references tomorrow though 👍🏻

@IanButterworth
Copy link
Member Author

I've added the headers for reference (they get pulled out of the jll by the wrap code): https://github.com/ianshmean/ImageIO.jl/tree/master/gen/libpng/ref_headers

@ihnorton
Copy link
Collaborator

FWIW, you might want to look at https://github.com/FugroRoames/LibPNG.jl (looks like they started with generated output and then customized by hand).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants