[osg-users] [osgPlugins] building the fbx plugin

241 views
Skip to first unread message

Tim Whowantstoknow

unread,
Oct 10, 2018, 11:04:41 AM10/10/18
to osg-...@lists.openscenegraph.org
Hi,

I have tried to build the OSG FBX plugin with the FBX SDK 2019 for Visual Studio 2015. I use VS 2017, however there was no such package from Autodesk.

In CMake I set the paths to the include directory. the FBX_LIBRARY to release/libfbxsdk.lib and the FBX_LIBRARY_DEBUG to debug/libfbxsdk.lib
I have not chosen the FBX_SHARED option, since I don't know, what it does.

CMake generated without a problem, but building the pluing in Visual Studio leads to a bunch of unresolved symbols.


Code:

1>------ Build started: Project: Plugins fbx, Configuration: Debug x64 ------
1>fbxRAnimation.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxAnimStack::ClassId" (?ClassId@FbxAnimStack@fbxsdk@@2VFbxClassId@2@A)
1>fbxRMesh.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxAnimStack::ClassId" (?ClassId@FbxAnimStack@fbxsdk@@2VFbxClassId@2@A)
1>fbxRNode.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxAnimStack::ClassId" (?ClassId@FbxAnimStack@fbxsdk@@2VFbxClassId@2@A)
1>fbxRAnimation.obj : error LNK2001: unresolved external symbol "private: static void (__cdecl* fbxsdk::FbxAnimCurveKey::mDeallocatorFct)(class fbxsdk::FbxAnimCurveKey_Impl *)" (?mDeallocatorFct@FbxAnimCurveKey@fbxsdk@@0P6AXPEAVFbxAnimCurveKey_Impl@2@@ZEA)
1>fbxRMesh.obj : error LNK2001: unresolved external symbol "private: static void (__cdecl* fbxsdk::FbxAnimCurveKey::mDeallocatorFct)(class fbxsdk::FbxAnimCurveKey_Impl *)" (?mDeallocatorFct@FbxAnimCurveKey@fbxsdk@@0P6AXPEAVFbxAnimCurveKey_Impl@2@@ZEA)
1>fbxRAnimation.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxAnimLayer::ClassId" (?ClassId@FbxAnimLayer@fbxsdk@@2VFbxClassId@2@A)
1>fbxRMesh.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxAnimLayer::ClassId" (?ClassId@FbxAnimLayer@fbxsdk@@2VFbxClassId@2@A)
1>fbxRNode.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxAnimLayer::ClassId" (?ClassId@FbxAnimLayer@fbxsdk@@2VFbxClassId@2@A)
1>fbxRCamera.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxCamera::ClassId" (?ClassId@FbxCamera@fbxsdk@@2VFbxClassId@2@A)
1>fbxRLight.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxLight::ClassId" (?ClassId@FbxLight@fbxsdk@@2VFbxClassId@2@A)
1>fbxRMesh.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sEmissive" (?sEmissive@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxMaterialToOsgStateSet.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sEmissive" (?sEmissive@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxRMesh.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sAmbient" (?sAmbient@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxMaterialToOsgStateSet.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sAmbient" (?sAmbient@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxRMesh.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sDiffuse" (?sDiffuse@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxMaterialToOsgStateSet.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sDiffuse" (?sDiffuse@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxRMesh.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sSpecular" (?sSpecular@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxMaterialToOsgStateSet.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sSpecular" (?sSpecular@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxRMesh.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sShininess" (?sShininess@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxMaterialToOsgStateSet.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sShininess" (?sShininess@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxRMesh.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sNormalMap" (?sNormalMap@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxMaterialToOsgStateSet.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sNormalMap" (?sNormalMap@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxRMesh.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sTransparentColor" (?sTransparentColor@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxMaterialToOsgStateSet.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sTransparentColor" (?sTransparentColor@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxRMesh.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sReflection" (?sReflection@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxMaterialToOsgStateSet.obj : error LNK2001: unresolved external symbol "public: static char const * const fbxsdk::FbxSurfaceMaterial::sReflection" (?sReflection@FbxSurfaceMaterial@fbxsdk@@2PEBDEB)
1>fbxRMesh.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxBlendShape::ClassId" (?ClassId@FbxBlendShape@fbxsdk@@2VFbxClassId@2@A)
1>fbxRMesh.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxMesh::ClassId" (?ClassId@FbxMesh@fbxsdk@@2VFbxClassId@2@A)
1>ReaderWriterFBX.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxAxisSystem const fbxsdk::FbxAxisSystem::OpenGL" (?OpenGL@FbxAxisSystem@fbxsdk@@2V12@B)
1>ReaderWriterFBX.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxGeometry::ClassId" (?ClassId@FbxGeometry@fbxsdk@@2VFbxClassId@2@A)
1>fbxMaterialToOsgStateSet.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxFileTexture::ClassId" (?ClassId@FbxFileTexture@fbxsdk@@2VFbxClassId@2@A)
1>fbxMaterialToOsgStateSet.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxLayeredTexture::ClassId" (?ClassId@FbxLayeredTexture@fbxsdk@@2VFbxClassId@2@A)
1>fbxMaterialToOsgStateSet.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxSurfaceLambert::ClassId" (?ClassId@FbxSurfaceLambert@fbxsdk@@2VFbxClassId@2@A)
1>fbxMaterialToOsgStateSet.obj : error LNK2001: unresolved external symbol "public: static class fbxsdk::FbxClassId fbxsdk::FbxSurfacePhong::ClassId" (?ClassId@FbxSurfacePhong@fbxsdk@@2VFbxClassId@2@A)
1>D:\OpenSceneGraph-3.6.0\bin\osgPlugins-3.7.0\osgdb_fbxd.dll : fatal error LNK1120: 21 unresolved externals
1>Done building project "osgdb_fbx.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 9 up-to-date, 0 skipped ==========




I don't really know what the problem may be. I have looked into the Linker options and the .lib file for FBX was correctly added.

Is this simply an incomaptibility with VS2017? Do I need to set other options?

Kind Regards,
Tim

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75064#75064





_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Tim Whowantstoknow

unread,
Oct 11, 2018, 3:46:51 AM10/11/18
to osg-...@lists.openscenegraph.org

>
> I have tried to build the OSG FBX plugin with the FBX SDK 2019 for Visual Studio 2015. I use VS 2017, however there was no such package from Autodesk.


Turns out, there is a FBX SDK 2019.2 Beta for VS 2017 which you can get, if you have an account with Autodesk. However, I still get a lot of the same errors, so I'd still appreciate any help.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75067#75067

Tim Whowantstoknow

unread,
Oct 11, 2018, 9:13:16 AM10/11/18
to osg-...@lists.openscenegraph.org
I finally figured out my problem. The FBX Solution needs the libfbxsdk, libxml2 and zlib .lib files
1. I was told to use the -md versions of the files
2. In VS in the Linker->Input->Additional Dependencies one of these was missing, i.e. cmake didn't fully configure this.

I first changed to the -md versions in cmake and afterwards added the missing .lib file, so I don't know if the first step really was necessary. With the two combined steps however it worked for FBX SDK 2019.2 for VS2017 and OSG 3.6.0

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75068#75068

wu

unread,
May 8, 2020, 3:45:50 AM5/8/20
to OpenSceneGraph Users
why I cant use  function  readnodefile(),  the function return false

在2018年10月11日星期四UTC + 8下午9:13:16,Tim Whowantstoknow写道:
我终于解决了我的问题。FBX解决方案需要libfbxsdk,libxml2和zlib .lib文件
1.告诉我使用文件的-md版本
。2.在VS中的链接器->输入->其他依赖项中,缺少其中一个,即cmake没有。没有完全配置它。

我首先在cmake中更改为-md版本,然后添加了丢失的.lib文件,所以我不知道第一步是否确实必要。但是通过两个步骤,它适用于VS2017和OSG 3.6.0的FBX SDK 2019.2

------------------
在此处在线阅读此主题:
http://forum.openscenegraph 。org / viewtopic.php?p = 75068#75068





______________________________ _________________
osg用户邮件列表
osg -... @列表。openscenegraph.org
http://lists.openscenegraph。org / listinfo.cgi / osg- users- openscenegraph.org
Reply all
Reply to author
Forward
0 new messages