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
Cannot generate rust bindings for fbx c++ library #937
Comments
Perhaps add
|
Sorry I forgot to transcribe the 'inline' statement because I did thousands of attempts, for a second I wished it would be that easy :-) |
Ah, yes, reading your error message more carefully it's not that simple :)
It seems like the SDK itself is not being linked in. I'd double-check these lines are having the desired effect
|
It looks like those two lines written like that are the only way I could make it compile without errors concerning library not found. |
Without a lot more information (especially the full build output with |
My other guess is it's an order sensitive link flag situation. If you're doing the link using gold or GNU ld, the |
Hi guys!
and others like these.
and finally the build completed successfully! what should I add to make it work? |
Please forget my last question, I solved by adding libfbx to LD_LIBRARY_PATH. 1: many destructors in the fbx library are declared as protected. For example the FbxManager class is declared like this:
This leads to an error during the build:
I can solve by modifing the headers and setting protected to public, is there another way? 2: I have a static method, used as constructor for the FbxIOSettings class, with this signature: How can I declare it to be used in rust? I converted the pManager argument as a UniquePtr, what about the pName, which is a const char* in C++? Thanks, |
I'm glad that the linkage issue got solved! The On the |
Hello!
I'm trying to generate rust bindings for the autodesk fbx c++ library to be able to use the fbx functionalities inside a rust application.
The fbx library is comprised of precompiled dynamic libraries and header files and it's publicly available.
I created a build.rs file like this:
My main.rs file is like this:
In shim.h I tried to create a shim for the FbxManager::Create() static method which is usually the first method called to initilaize the library.
This is shim.h
When I run cargo build with this situation I get an ld error that says:
I would like to ask help for this specific case but also how in general I should behave when trying to bind to c++ static methods and creating instances of c++ classes.
Many thanks,
Frank
The text was updated successfully, but these errors were encountered: