brendan-rius / jupyter-c-kernel

Minimal Jupyter C kernel
MIT License
574 stars 144 forks source link

Unable to load external libraries in Windows using cflags/ldflags #76

Open fitsie007 opened 3 years ago

fitsie007 commented 3 years ago

The following works on Mac/Linux to import the MySQL library, but does not work on Windows. Is there a specific requirement for specifying Windows paths in the cflags/ldflags?

//%cflags:-std=c99 -L/usr/local/mysql/lib -I/usr/local/mysql/include -lmysqlclient

Windows paths have drive letters, spaces, etc, and resemble the following: //%cflags:-std=c99 -L"C:program Files/.../mysql/lib"

I tried changing the path to "./program Files/.../mysql/lib" with variants of "\" or "//", but this still throws errors that the files cannot be found.

Any suggestion for a fix would be appreciated.

jameswdelancey commented 2 years ago

You can edit the kernel.py file, then restart your kernel, to add verbose logging into the gcc args to debug this on your machine:

gcc -v