I’m fearly new to node addon modules and trying to build a litle gtk interface in it. It builds succesfull but at runtime, I get
node: symbol lookup error: /home/laurens/Documenten/Code/wall_controller/build/Release/display.node: undefined symbol: gtk_init
I figured that the ldflags are not working but I can’t figure out why
binding.gyp
{
"targets": [
{
"target_name": "display",
"sources": [
"ui/main.cpp"
],
"cflags": [
"-g",
"<!(pkg-config --cflags gtk+-3.0 webkit2gtk-4.1)"
],
"ldflags": [
"<!(pkg-config --libs gtk+-3.0 webkit2gtk-4.1)"
],
"include_dirs": [
"<!(node -e "require('node-addon-api').include")"
],
'dependencies': [
"<!(node -p "require('node-addon-api').targets"):node_addon_api_except",
],
"defines": [
"NAPI_VERSION=3"
]
}
]
}
ldd build/Release/display.node
linux-vdso.so.1 (0x00007fffe3ffc000)
libgtk3-nocsd.so.0 => /lib/x86_64-linux-gnu/libgtk3-nocsd.so.0 (0x00007a1f7b5e0000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007a1f7b200000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007a1f7b5b3000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007a1f7ae00000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007a1f7b4ca000)
/lib64/ld-linux-x86-64.so.2 (0x00007a1f7b612000)
pkg-config –libs gtk+-3.0 webkit2gtk-4.1
-lwebkit2gtk-4.1 -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lsoup-3.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lgio-2.0 -ljavascriptcoregtk-4.1 -lgobject-2.0 -lglib-2.0
To me it all looks fine except for the LDD output. What am I missing?