Comments (5)
duk_eval_string()
is implemented as a macro in duktape.h
. All Duktape functions are potentially implemented as macros and whether an API call is a macro or a function changes from time to time, depending on what's most convenient.
What problem are you encountering in practice?
from duktape.
As a sidenote: when using Duktape as a .so
one important note is that when you include duktape.h
in the calling program, you should compile to calling program with the same DUK_OPT_xxx
options you use when compiling the Duktape shared library. This is needed because some Duktape options may affect API binary compatibility (rare, but possible).
Of course, if you have no custom options, this is not an issue.
from duktape.
Thank you.
For the problem in practice:
julia> using Duktape
julia> d = Duktape.duk_create_heap()
duk_context(Ptr{Void} @0x0bc3f740)
julia> Duktape.duk_eval_string(d,"a = 33")
ERROR: ccall: could not find function duk_eval_string in library /home/lobi/juliarepo/duktape-0.11.0/src/duktape.so
in duk_eval_string at /home/lobi/.julia/v0.3/Duktape/src/Duktape.jl:16
I wasn't aware that the some of the APIs are defined via macro, so i implemented the interface as call to the API name. That obviously fails with duk_eval_string.
from duktape.
Good point - I'll add a note about being sure to include duktape.h
in calling files. Even if a calling program compiles and links, it might use wrong types in the call (the compiler's guess can quite easily be incorrect w.r.t. typing).
I'll reopen this until there's some additional text in the guide.
from duktape.
This should cover the issues discussed here: aa28c89
from duktape.
Related Issues (20)
- Is there a way to build this on systems without `npm`? HOT 4
- Reading JS variable within C. HOT 3
- `duk_to_pointer` shows an use-after-free HOT 1
- Json Loop
- Embedding for rust. HOT 2
- Disable usage eval in Javascript code HOT 1
- Include test suite in release tarballs
- Does Buffer have plans to support more encodings?
- Crash Scenario (duk_dup_top and embedding JSON object data within itself) - Solved HOT 4
- webpacked "hello world" from Kotlin/JS erroring out with "empty expression not allowed" HOT 3
- [HELP] Build with emcc to execute wasm on nodejs
- Object.assign throws RangeError for a large number of arguments
- Embedding Duktape in Lazarus / Free Pascal
- A possible performance problem of calling sort function with long array
- Q: Example of using JS callbacks HOT 11
- Makefile.cmdline builds a broken binary that instantly segfaults
- dukluv forward compat HOT 3
- New release? 🤔 HOT 2
- loading handlebars helpers HOT 1
- Is nested duk_pcall_* from the same thread supported? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from duktape.