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

Reading multiple header files for a single library #5

Open
stanleygu opened this issue Jan 24, 2013 · 6 comments
Open

Reading multiple header files for a single library #5

stanleygu opened this issue Jan 24, 2013 · 6 comments

Comments

@stanleygu
Copy link

Is there support for reading multiple header files that belong to a single library? Passing in something like *.h does not seem to work.

@tjfontaine
Copy link
Owner

At the moment there isn't a way to specify multiple files from the command line, but you could create a header file that merely includes the headers you're interested in. find . -name \*.h -exec echo '#include "{}"' \; > libclangify.h

@stanleygu
Copy link
Author

Thanks, this works, however, there is some error in the output.

assert.js:102
  throw new assert.AssertionError({
        ^
AssertionError: the field "buffer" already exists in this Struct type
    at Function.defineProperty (/Users/stanleyg/Dropbox/projects/libsbml/node_modules/ref-struct/lib/struct.js:205:3)

I have created an example gist here.

This is the library I am trying to wrap around.

I also noticed that there seems to be a type uLong that isn't caught by ffi-generate, highlighted here.

@tjfontaine
Copy link
Owner

in StringBuffer_t can you try renaming buffer to someBuffer and see if that solves the problem for you? I will also investigate the ulong issue.

@stanleygu
Copy link
Author

That rename did the trick, now it runs into the uLong issue:

assert.js:102
  throw new assert.AssertionError({
        ^
AssertionError: Could not determine the `ffi_type` instance for type: ulong
    at Type (/Users/stanleyg/Dropbox/projects/libsbml/node_modules/ffi/lib/type.js:121:3)

@tjfontaine
Copy link
Owner

is there any more to that stacktrace?

@stanleygu
Copy link
Author

Yes, here is the entire trace:

stanleyg$ node bindings.js
assert.js:102
  throw new assert.AssertionError({
        ^
AssertionError: Could not determine the `ffi_type` instance for type: ulong
    at Type (/Users/stanleyg/Dropbox/projects/libsbml/node_modules/ffi/lib/type.js:121:3)
    at CIF (/Users/stanleyg/Dropbox/projects/libsbml/node_modules/ffi/lib/cif.js:41:19)
    at ForeignFunction (/Users/stanleyg/Dropbox/projects/libsbml/node_modules/ffi/lib/foreign_function.js:33:13)
    at /Users/stanleyg/Dropbox/projects/libsbml/node_modules/ffi/lib/library.js:68:16
    at Array.forEach (native)
    at new Library (/Users/stanleyg/Dropbox/projects/libsbml/node_modules/ffi/lib/library.js:47:28)
    at Object.<anonymous> (/Users/stanleyg/Dropbox/projects/libsbml/bindings.js:493:19)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)

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

2 participants