This project has moved and is read-only. For the latest updates, please go here.

DirectXTK Unresolved Externals using Default App. SDKMesh

May 16, 2014 at 3:17 AM
Edited May 16, 2014 at 3:23 AM
I've finally produced something that builds to unresolved externals and need a little help with loading a SDKMesh. I did follow the other links to setup the compiler and think my include and lib are good. My code is below: I place the error code there too. I'm not completely sure what I'm doing though I am getting the hang of it and need a little help. I'm leaning towards the device being wrong and any help would be a blessing.

Visual Studio 2013...
std::unique_ptr<EffectFactory>              m_effectFactory;
std::unique_ptr<Model>                      m_Model;

void Sample3DSceneRenderer::CreateDeviceDependentResources()
// Is this correct? I am not sure if device is correct?
    m_effectFactory.reset(new EffectFactory(m_deviceResources->GetD3DDevice()));
    m_Model = Model::CreateFromSDKMESH(m_deviceResources->GetD3DDevice(), L"StealthFighter.x", *m_effectFactory, true);


Error   1   error LNK2019: unresolved external symbol "public: __thiscall DirectX::EffectFactory::EffectFactory(struct ID3D11Device *)" (??0EffectFactory@DirectX@@QAE@PAUID3D11Device@@@Z) referenced in function "public: void __thiscall Evolution::Sample3DSceneRenderer::CreateDeviceDependentResources(void)" (?CreateDeviceDependentResources@Sample3DSceneRenderer@Evolution@@QAEXXZ)   
I'm using the default DirectX App program created with visual studio Windows Store Apps..

Even though it looks like a .x file it's really a sdkmesh and works with simple sample...

May 16, 2014 at 7:07 PM
Edited May 17, 2014 at 8:01 PM
Did you build the DirectXTk library as part of your solution, or are you using some prebuilt static library?

There are issues if you use a different compiler toolset to build a static lib and the project, so the ideal solution is to build the DirectX Tool Kit project as part of your solution so they all use the same version (including Updates).
May 18, 2014 at 3:35 AM
Edited May 18, 2014 at 3:53 AM
Hello Mr Walbourn,

I did find that building the TK directly with the project solves the create problem and then creates a dll problem. I believe my problem is that the 2013 build is automatically d3d11_2 on everything and it fails to load or draw. The root problem for the model looks to be that the 2013 program creation for framework 4.5.1, 4.5, 4.0, 3.5 (all of them) is "ID3D11Device2" while the TK uses "ID3D11Device". I will make sure I use the 2013 version of the TK I just downloaded and try it again. I'm also going to take a peak at the package manager files that are downloaded and check for that difference as well. It's a nice TK.

May 18, 2014 at 6:20 AM
Edited May 18, 2014 at 6:21 AM
You can use QueryInterface (or the ComPtr::As method) to convert ID3D11Device2 to ID3D11Device.
May 18, 2014 at 8:48 AM
Edited May 18, 2014 at 8:48 AM
Thanks for the help on everything! I must be getting the wrong library with the Package-Manager though I might try adding it again just for the fun of it. I had tried to convert the pointer earlier then the "context" needed to be converted so I gave up on it. With the default layout and 2013 version directly installed I still had a dll error on create. All I did for that part is change the assets\my.sdkmesh to assests/my.sdkmesh because I noticed my compiler complaining about an unrecognized escape sequence "S" during the build. (just something to look for),, When I first added my mesh it was compiling to a cmo so I adjusted the settings and added all the additional texture assets to the subfolders. I appreciate the help with getting the base going and have a good starting point to start converting some of my code now.

Thanks Again,
May 19, 2014 at 1:48 AM
Unfortunately, the NuGet version is somewhat out of date. The latest version is available on this CodePlex along with instructions to add it to VS solutions.
May 24, 2014 at 5:01 PM
This issue may be related to a different problem that I have with paths in Visual Studio. Microsoft actually installed everything on my computer for me because there were serious errors when I was trying to license this computer with 64-Bit Windows. Microsoft said I have 6 additional months of tech-support and it took over a week just to get this computer updated with the latest and greatest. All of my software licensing and support for Windows 8.1 and Visual Studio 2013 is paid for at the moment at least. When it takes a week just to get software to install and then run into every problem known to man it gets frustrating. You can find the issue here:

I also have a problem with the starter kit that I downloaded here:

and it's reported here:
May 24, 2014 at 8:52 PM
Unusual system corruptions or installation problems are indeed extremely frustrating, and I'm sorry that you were having so much trouble with it.

I'm not sure if I understand the first issue you put into the VS Connect, but "New Filter" does not actually create any subfolder names at all in Visual Studio. It's just a way of organizing files within the tree view.

Is this is a new PC that came with Windows 8.1, or is this an older PC you have upgraded?
May 25, 2014 at 6:25 PM
Edited May 25, 2014 at 10:42 PM
My PC is updated with windows 8.1 and I think RC2 is the latest update. As far as the path problem I guess I am the only one who has it. The path problem is that when I create projects the filter paths are messed up. I create any new project and can add a filter/folder. When I right click on the folder to add a file to it the location is wrong for the file itself. IE if I create NewFilter1 the path should be NewFilter1 when I right click on it but it defaults to the app folder instead. If I save the file it appears like it is in the NewFilter1 but when I open Windows Explorer the file is actually located in the App directory. This happens every time on my system and when I do not notice this problem or go through each filter to make sure the file is actually where it's supposed to I end up with a million questions for you. I feel bad about some of the things I asked but it really isn't all my fault because nearly all my projects get messed up because of wrong paths. I've also saved entire projects that worked and tried to restore them from a direct backup and have the same exact problem. A good example is the problem you helped me with last time. I saved the working project and brought it back in as a restored backup and the model is missing from the file.

Another example is the MACRO to actual installed packages is different than the actual default directory where they are installed. The macro is app_packages and the actual packages are installed in the packages directory. Stuff like this. It's not your fault unless you designed it to mess me up. :))

The problem is magically fixed and the folders are called "folders" instead of "filters" now. I'm not sure if it's a setting or an update that fixed it though my new programs actually start out without errors on the main application.

I can see why everyone I reported this too was confused as well. My VS application actually said FILTER instead of FOLDER.