Cpp.jl icon indicating copy to clipboard operation
Cpp.jl copied to clipboard

Error with Expr

Open shaguniitb opened this issue 12 years ago • 6 comments

I've been trying to use this library to call C++ functions from julia. I'm getting this error:

ERROR: Expr: too few arguments (expected 3) in include_from_node1 at loading.jl:76 in process_options at client.jl:255 in _start at client.jl:318

I've tried editing the file Cpp/src/Cpp.jl file line 62: ex.args[1].args[1] = Expr(:quote, symbol(string(fstr,pstr)))

and gotten the following errors:

Changes and corresponding errors:

Change: ex.args[1].args[1] = Expr(:quote, symbol(string(fstr,pstr)), Any)

ERROR: type: Expr: expected Array{Any,1}, got Symbol in include_from_node1 at loading.jl:76 in process_options at client.jl:255 in _start at client.jl:318

Change: ex.args[1].args[1] = Expr(:quote, {symbol(string(fstr,pstr)), 1}, Any)

ERROR: in anonymous: ccall: could not find function _Z2oc in library libc in anonymous at no file

Can this library be updated to resolve such errors?

shaguniitb avatar May 20 '13 20:05 shaguniitb

Which version of Julia are you running?

timholy avatar May 21 '13 19:05 timholy

If it's version 1.something, try the version of cpp.jl in extras/, not this package.

timholy avatar May 21 '13 19:05 timholy

I upgraded Julia to version 1.2, and the first error is gone. Now, I've the error:

ERROR: in anonymous: ccall: could not find function _Z2oc in library libc in anonymous at no file

shaguniitb avatar May 21 '13 21:05 shaguniitb

With 1.2, you shouldn't use this package. Use the one in extras/. In fact you want to say Pkg.rm("Cpp").

Let me know if this fixes it.

timholy avatar May 21 '13 22:05 timholy

To use the one in extras/, I think you just say

require("cpp.jl")

but it's been a while, I may not be remembering correctly.

timholy avatar May 21 '13 22:05 timholy

Or wait, maybe given that the error is gone, you're OK. Can you run the package test? include("/path/to/Cpp/test/cpp.jl"). This will only work if you've run the build script.

timholy avatar May 21 '13 22:05 timholy