I am writing nodejs code and want to use C++ code (backend.cpp which includes 'mysql/mysql.h') using node-gyp to compile. I am getting this error while building:
module.js:356 Module.extensions[extension](this, filename); ^ Error: ____/build/Release/backend.node: undefined symbol: mysql_init
Can anyone help? How can I instruct node-gyp to link mysql.h to the target backend.node?
Have you added it in the libraries
list in your binding.gyp file?
Here's a short example:
{
"targets": [
{
"target_name": "backend",
"sources": [<comma separated source names>],
"include_dirs":[<comma separated include dirs>],
"libraries": [<comma separated library paths>]
}
]
}
You should also take a look at the complete Gyp Language Specification
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With