-
Notifications
You must be signed in to change notification settings - Fork 0
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
Newbie! How to use #1
Comments
In basic you can find working example that link to libweview.so. |
If you want to link with object instead of library you need to place the object file in source directory and change
to
In dub.sdl. |
I managed to get it working just before your reply. Using windows PC so was able to include the library locally and link through dub. I am struggling with binding functions to the webview instance. Do you have any examples of how that can be done? |
Do you mean how to use this function ? void bind(string name, BindCallback fn, void* arg); |
Yes, i cant ever seem to get the signature of the function correct and I believe a context is required whilst program is running according to webview docs |
extern(C) void callBack(string seq, string req, void* arg)
{
// code
}
w.bind("name", &callBack, null); |
I didn't find this thread until after I got webview working. I did things differently. After downloading the webview project, I ran the build.sh in webview/script. This built webview.o as well as libwebview.so in the webview/build/ directory. Then, since I an using dub.json, I appended the following property which allows the linker to find the lib: It seems like $PACKAGE_DIR is your project root where the dub.json file is located. Hope that helps someone! |
I am new to D and would like to convert an existing project which uses webview to D. I am wondering how to use this library, specifically linking. I have tried compiling webview to object file and linking but cannot get it to work. Do you have any basic guidelines?
The text was updated successfully, but these errors were encountered: