Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Compiling a program using the FBX SDK from the command line using Clang++ on Windows

jcpSJ5MS
Explorer

Compiling a program using the FBX SDK from the command line using Clang++ on Windows

jcpSJ5MS
Explorer
Explorer

I was wondering if anyone had attempted to build an executable from the command line using clang++ that's using the FBX SDK on Windows. Like you could on Linux?

 

if this is even possible, what would be the steps. Thx)

0 Likes
Reply
Accepted solutions (1)
296 Views
1 Reply
Reply (1)

jcpSJ5MS
Explorer
Explorer
Accepted solution

Hum I seem to have made it work (but anybody could share his/her experience with this, just in case, I am missing something I would appreciate):

 

  • Downloaded the FBX SDK 2020 for SV2019 (would love if someone could explain the difference between this and Windows Store and Windows Universal App Platform?). Installed that in the folder where the executable lives (don't want to deal with $PATH for now).
  • wrote simple FBX program as given in docs and create simple FBX file with a sphere in it (from Maya)
  • ` clang++ -o fbx fbx.cpp -llibfbxsdk -I"D:/Program Files/Autodesk/FBX/FBX SDK/2020.3.2/include"/` in GitBash terminal on Windows 10 (again the lib files live where the ./fbx program lives).

 

./fbx
Name of the node pSphere1

 

That's it. I am little confused about the use of md or mt lib. If something could clarify this but, would appreciate.

 

 

#include <iostream>

#include <fbxsdk.h>

void PrintNode(FbxNode* pNode)
{
    std::cerr << "Name of the node " << pNode->GetName() << std::endl;
}

int main(int argc, char **argv)
{
    const char* lFilename = "./sphere.fbx";

    FbxManager* lSdkManager = FbxManager::Create();

    FbxIOSettings* ios = FbxIOSettings::Create(lSdkManager, IOSROOT);

    lSdkManager->SetIOSettings(ios);

    FbxImporter* lImporter = FbxImporter::Create(lSdkManager, "");

    if (!lImporter->Initialize(lFilename, -1, lSdkManager->GetIOSettings())) {
        throw std::runtime_error("call to FbxImporter failed");
    }

    FbxScene* lScene = FbxScene::Create(lSdkManager, "myScene");

    lImporter->Import(lScene);

    lImporter->Destroy();

    FbxNode* lRootNode = lScene->GetRootNode();

    if (lRootNode) {
        for (int i = 0; i < lRootNode->GetChildCount(); ++i) {
            PrintNode(lRootNode->GetChild(i));
        }
    }

    lSdkManager->Destroy();

    return 0;
}