-
Notifications
You must be signed in to change notification settings - Fork 8
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
C Compiler error #4
Comments
Please make sure you have required libraries installed. Error indicates that its missing required libraries. Ensure you have |
It is installed :(
|
When using
|
But, I don't know if
|
The $ dpkg -L libgtk-3-dev | grep '\.pc'
/usr/lib/x86_64-linux-gnu/pkgconfig/gdk-3.0.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/gdk-broadway-3.0.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/gdk-wayland-3.0.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/gdk-x11-3.0.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-3.0.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-broadway-3.0.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-unix-print-3.0.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-wayland-3.0.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-x11-3.0.pc
$ pkg-config --modversion gtk+-3.0
3.24.20 |
Important update I successfully compiled the original examples from github.com/webview/webview, with both Go, C++ and C examples. Every example compiled and executed perfectly, which helps to conclude that my system is fine. My only suspicion is that the |
What is the output of command |
The output is:
|
No errors when cloning your repo and running $ make
g++ -c -o ext/webview.o -DWEBVIEW_GTK=1 `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0` -std=c++11 ext/webview.cc
ar rcs ext/libwebview.a ext/webview.o |
I'm unable to reproduce error on Linux (Fedora). Maybe you can try changing the link annotation settings in |
FYI: I'm getting the same errors on Linux Mint 20.3 and 19.2 (64bit, crystal 1.3.2, libgtk-3-dev is installed) |
Are you getting same error when you separately run |
|
I encountered the same issue, but the fix was quite stunning: I just switched the order of the @[Link] attributes for linux (don't know about other platforms) and it worked! @[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0`")]
@[Link(ldflags: "#{__DIR__}/../ext/libwebview.a -lstdc++")] If someone else could validate this change doesn't break anything, it would be great. 😁 |
Thanks, @pedromsilvapt Pedro! I will try to validade this as soon as possible! |
This worked for me! Thanks @pedromsilvapt ! |
Environment
Ubuntu 20.04 64bit
Crystal 1.2.2 [6529d725a] (2021-11-10)
Installed pre-requisites
sudo apt install pkg-config build-essential libgtk-3-dev libwebkit2gtk-4.0-dev
To execute the first example on readme, on a void directory, I created both
shard.yml
and a crystal fileurl.cr
with:shard.yml
url.cr
And
shards install
goes well:The C compiler error
But when trying to run the example with
crystal run url.cr
, I get:Final error
Long error:
Open here:
The text was updated successfully, but these errors were encountered: