OpenUSD icon indicating copy to clipboard operation
OpenUSD copied to clipboard

Unresolved External Symbols when trying to use custom schema & general custom schema guidance

Open msf567 opened this issue 8 months ago • 2 comments

I am trying to consume my new schema in Visual Studio, but I must be doing something wrong because I am getting unresolved external symbol errors.

Here is my schema file for reference:

#usda 1.0
(
    """InteractableMesh Schema"""
    subLayers = [
        @usdGeom\schema.usda@
    ]
)

over "GLOBAL" (
    customData = {
        string libraryName = "SC"
        string libraryPath = "./"
        string libraryPrefix = "SC"
    }
) {}

class "InteractiveMesh" (
    doc = """A mesh that can be interacted with."""
    inherits = </Gprim>
    customData = {
        string className = "IMesh"
    }
)
{
    float state = 1.0 (
        doc = "The state of the interactable mesh"
    )
}

class ComplexPrim "ComplexPrim" (
    doc = """An example of a untyped IsA schema prim"""
    # Inherits from </SimplePrim> defined in simple.usda.
    inherits = </InteractiveMesh>
    customData = {
        string className = "Complex"
    }
)  
{
    string complexString = "somethingComplex"
}

The line that is failing is: auto myComplex = pxr::SCComplex::Define(stagePtr, pxr::SdfPath("/MyComplexObject"));

The two errors: unresolved external symbol "_declspec(dllimport) public: virtual cdecl pxrInternal_v0_24__pxrReserved::SCComplex::~SCComplex(void)" (imp??1SCComplex@pxrInternal_v0_24__pxrReserved@@UEAA@XZ) referenced in function WinMain

unresolved external symbol "declspec(dllimport) public: static class pxrInternal_v0_24__pxrReserved::SCComplex cdecl pxrInternal_v0_24__pxrReserved::SCComplex::Define(class pxrInternal_v0_24__pxrReserved__::TfWeakPtr<class pxrInternal_v0_24__pxrReserved__::UsdStage> const &,class pxrInternal_v0_24__pxrReserved__::SdfPath const &)" (imp?Define@SCComplex@pxrInternal_v0_24__pxrReserved_@@SA?AV12@AEBV?$TfWeakPtr@VUsdStage@pxrInternal_v0_24__pxrReserved__@@@2@AEBVSdfPath@2@@Z) referenced in function WinMain

Some things to note:

  • I am definitely linking to the built .lib file in my visual studio project
  • My header files seem to be configured correctly (my compiler recognizes the SCComplex type just fine, and exposes the Define method)
  • Do I need to bring in the actual cpp files to my visual studio project? like "complex.cpp" etc? When I do that, I get a host of other errors, and it doesn't seem like that should be necessary because I am linking to the generated .lib file.

What am I missing? I have been trying to generate a simple schema for days, I would really appreciate some guidance here and maybe other people int he future will find this helpful.

Thanks!

msf567 avatar Jun 24 '24 18:06 msf567