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

Unable to load libclang #3

Open
amitpanghal opened this issue Dec 2, 2014 · 10 comments
Open

Unable to load libclang #3

amitpanghal opened this issue Dec 2, 2014 · 10 comments

Comments

@amitpanghal
Copy link

I have installed node-ffi-generate on my system for genrating bindings of a dll providing the header file and the library but it throws following error :-
"Unable to load libclang, make sure you have 3.2 installed, either specify -L or
have llvm-config in your path"

My command is > ffi-generate -f PremiereSoftphone.h -l SoftphoneLib.dll

@zrichmond
Copy link

I am currently having the same problem. Is 3.2 specifically required or will 3.4 or 3.5 work?

@zrichmond
Copy link

Installing libclang locally instead of globally worked for me:
npm install libclang

@lygstate
Copy link

I have the same problem.

@mping
Copy link

mping commented Mar 29, 2015

Same here.

@dubcanada
Copy link

I managed to get this working by doing the following... I have no idea which part of it actually fixed it lol.

cd into my node_modules/ffi-generate and npm install libclang

Then run

ffi-generate.js -f /usr/local/Cellar/libgphoto2/2.5.5/include/gphoto2/gphoto2.h -l libgphoto2 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/

Where /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/ is where my libclang.dylib is located

@basickarl
Copy link

Same issue here, no fix?

@basickarl
Copy link

I did

sudo apt-get install libclang-3.8-dev
Then:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/usr/lib/llvm-3.8/lib/"

@sincerefly
Copy link

sincerefly commented Apr 10, 2018

same issue (windows 7 x64)

@VishwasShashidhar
Copy link

@dubcanada Your solution works indeed :) thanks.

@noth8
Copy link

noth8 commented Jun 27, 2019

Hello guys, you need just specify path to your libclang.so :

// I have already tested versions from 3.6 to 6 and they provide same output
// except version 7 which brakes it down.
// So the maximum supporting version is libclang-6.0-dev
sudo apt install libclang-6.0-dev

// then find location if you don't know where it's located
sudo find /usr/ -name "libclang.so"

// specify path  -L /usr/lib/llvm-6.0/lib/ (but with your path) like @dubcanada did
// or clearly variant --libclang /usr/lib/llvm-6.0/lib/
ffi-generate -f PremiereSoftphone.h -l SoftphoneLib.dll --libclang /usr/lib/llvm-6.0/lib/

Always use ffi-generate command with libclang path option.

You don't need to install libclang package to ffi-generate dir like other mentioned above.

Also, you can get rid of globally installed ffi-generate by installing it locally then launch like this npx ffi-generate and npx( shipped by default with npm) will find it locally.

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

No branches or pull requests

9 participants