Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Linking fbxsdk 2019.2 with libxml2

Linking fbxsdk 2019.2 with libxml2

Anonymous
Not applicable
2,216 Views
3 Replies
Message 1 of 4

Linking fbxsdk 2019.2 with libxml2

Anonymous
Not applicable

Hi,

 

It has come to my attention that the fbxsdk does not already come with libxml2 and libz, as discussed on this post: https://forums.autodesk.com/t5/fbx-forum/fbx-sdk-2019-2-released/td-p/8434571

 

I've been trying to link the sdk to the libxml2 installed on my system with no success. I tried to reinstall the sdk after making sure that I had libxml2 and libxml2-devel files installed, but it still doesn't link.

 

I'm not sure at this point what I have to do to make it work, since in the dev documentation the only thing mentioned when installing the sdk is to "Follow the instructions in <yourFBXSDKpath>\Install_FbxFileSdk.txt" , and the readme only contains information about how to build the sample code, not the sdk.

 

I'm running centos 7.

 

Let me know if more information on my system is needed.

 

Any help is welcome.

 

Thanks

0 Likes
2,217 Views
3 Replies
Replies (3)
Message 2 of 4

regalir
Autodesk
Autodesk

Hi,

if you have properly installed libxml2, the library libxml2.so should have been installed in /usr/lib64 (assuming you are running on a 64 bit machine). The program you are building that links with the fbxsdk, will also need to link with libxml2. Typically, your makefile should have also have a -lxml2 directive. For example, the link command for the Animation samples is:

/opt/rh/devtoolset-6/root/usr/bin/g++  -D_DEBUG  -g   -fno-implicit-inline-templates -std=c++11  -Wno-deprecated-declarations -Wchar-subs
cripts -Werror -fPIC -fno-strict-aliasing -D__x86_64 -pthread   -rdynamic CMakeFiles/Animation.dir/Animation/main.o CMakeFiles/Animation.
dir/Common/Common.o  -o /home/regalir/Development/fbxsdk/build/gcc4_x64_lib/debug/Animation  -L/home/regalir/Development/fbxsdk/build/gcc
4_x64_lib/debug -Wl,-rpath,/home/regalir/Development/fbxsdk/build/gcc4_x64_lib/debug -lxml2 -lz -Wl,-Bstatic -lfbxsdk -Wl,-Bdynamic -lxml
2 -lz -ldl -lpthread -Wl,-Bstatic -lfbxsdk -Wl,-Bdynamic -ldl -lpthread 

Note that this line has been generated by cmake when I asked to create the makefiles for the FbxSdk samples. The values on your machine may be slightly different.

 

0 Likes
Message 3 of 4

Anonymous
Not applicable

I do have libxml2.so in the lib64 folder. 

I'm building my project using cmake.

 

First I do "find_package(LibXml2 REQUIRED)" to find the location to the libxml2.so, then I do "target_link_libraries(<ProjectName> <path to fbxsdk.so> ${LIBXML2_LIBRARIES})". 

 

Then, we are using python, so in python, I try to "import libfbxsdk.so", but it gives me the error "ImportError: ./libfbxsdk.so: undefined symbol: xmlFree".

 

Thanks 

0 Likes
Message 4 of 4

regalir
Autodesk
Autodesk

The libfbxsdk.so is not a proper module for Python. This is a pure C++ library.

 

We never validated that you can use it directly with Python. So, even if you import libxml2 before importing libfbxsdk.so, you will get the Python error:

ImportError: dynamic module does not define init function (initfbxsdk)

 

If you want to use the FBX SDK inside a Python environment you should install the fbxpythonsdk instead. This package provides a "python binding" module.

 

Notes:

- these bindings do not cover 100% of the FBX SDK functions, but the majority of the functionality is available.

- starting with version 2019.1 the package only contains the libraries for Python 2.7 ucs4 x64. Previous versions (2019.0 and earlier) provide the libraries for Python 2.7 and 3.3, x86 and x64.

- In the next release, we will also publish the sources to compile the Python bindings so users can build them for their desired Python version.

0 Likes