Community
FBX Forum
Welcome to Autodesk’s FBX Forums. Share your knowledge, ask questions, and explore popular FBX topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

1 REPLY 1
SOLVED
Reply
Message 1 of 2
jcpSJ5MS
278 Views, 1 Reply

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

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)

1 REPLY 1
Message 2 of 2
jcpSJ5MS
in reply to: jcpSJ5MS

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;
}

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report