Skip to content
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

Compile with node-gyp #5

Closed
clayrisser opened this issue Sep 17, 2017 · 4 comments
Closed

Compile with node-gyp #5

clayrisser opened this issue Sep 17, 2017 · 4 comments

Comments

@clayrisser
Copy link
Owner

https://github.com/nodejs/node-gyp

@clayrisser
Copy link
Owner Author

I tried to compile with node-gyp, but I get a Dynamic Linking Error undefined symbol when I try and run the application. It compiles just fine but seems to fail at runtime. Anyone have any clues to what is going on?

/home/jamrizzi/Downloads/node-gtk3/node_modules/ffi/lib/dynamic_library.js:74
    throw new Error('Dynamic Linking Error: ' + err)
    ^

Error: Dynamic Linking Error: /home/jamrizzi/Downloads/node-gtk3/build/Release/window.so: undefined symbol: gtk_window_new
    at new DynamicLibrary (/home/jamrizzi/Downloads/node-gtk3/node_modules/ffi/lib/dynamic_library.js:74:11)
    at Object.Library (/home/jamrizzi/Downloads/node-gtk3/node_modules/ffi/lib/library.js:45:12)
    at Object.<anonymous> (/home/jamrizzi/Downloads/node-gtk3/lib/window/index.js:26:28)
    at Module._compile (module.js:573:30)
    at loader (/home/jamrizzi/Downloads/node-gtk3/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/home/jamrizzi/Downloads/node-gtk3/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Module.require (module.js:517:17)
error Command failed with exit code 1.

@clayrisser
Copy link
Owner Author

You can duplication this error from the node-gyp branch.

https://github.com/jamrizzi/node-gtk3/tree/node-gyp

@clayrisser
Copy link
Owner Author

I made some headway with node-gyp.

4abb538

It turns out that the problem is with the order of the cflags. The cflags are supposed to be placed after the input/output files are specified, but node-gyp does it in the wrong order.

nodejs/node-gyp#1298

https://stackoverflow.com/questions/46354002/how-do-i-add-flags-after-input-and-output-specified-not-before-with-node-gyp

@clayrisser
Copy link
Owner Author

clayrisser commented Sep 22, 2017

I had to create a custom patch for node-gyp in order to get this to work. It works though!

https://github.com/jamrizzi/node-gyp/commit/f47939c6d0961ac99ed9288086a7589223a5da07

efbfd8f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant