locked
Adding XAML to the default Direct3D Cube renderer App

    Question

  • I am trying to create a basic Metro Direct3D app and add xaml overlay to it.

    I created the default Metro Direct3D app from VS2012 which creates a basic 3d app that renders a rotating cube onto the screen. Then, I am trying to add the App.xaml and obviously make the program's entry point the App.xaml rather than the default Direct3DApp class(The class that implements the IFrameWorkView .....).

    But no matter how I try to do it I keep getting unexplained LNK errors...

    Basically, in my App.xaml,  if I do this :

    <Application
        x:Class="ProjectName.App"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    </Application>

    I get this :

    The generated file "app.g.h" generates the code : 
    namespace ProjectName
    {
    ....
    }
    And this code in turn generates the following error  when tried to build:
    Error 1 error C2757: 'ProjectName' : a symbol with this name already exists and therefore this name cannot be used as a namespace name (App.xaml.cpp)
    c:\users....\app.g.h

    and if I do this :

    <Application
        x:Class="ADifferentName.App"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    </Application>

    I keep getting these:

    Error 1 error LNK2019: unresolved external symbol "public: virtual void __cdecl XAMLDirect3DGame::App::[Windows::UI::Xaml::IApplicationOverrides]::OnLaunched(class Windows::ApplicationModel::Activation::LaunchActivatedEventArgs ^)" (?OnLaunched@?QIApplicationOverrides@Xaml@UI@Windows@@App@XAMLDirect3DGame@@U$AAAXP$AAVLaunchActivatedEventArgs@Activation@ApplicationModel@4@@Z) referenced in function "[thunk]:public: virtual void __cdecl XAMLDirect3DGame::App::[Windows::UI::Xaml::IApplicationOverrides]::OnLaunched`adjustor{16}' (class Windows::ApplicationModel::Activation::LaunchActivatedEventArgs ^)" (?OnLaunched@?QIApplicationOverrides@Xaml@UI@Windows@@App@XAMLDirect3DGame@@WBA@$AAAXP$AAVLaunchActivatedEventArgs@Activation@ApplicationModel@4@@Z) C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\XAMLDirect3DApp\App.xaml.obj
    Error 2 error LNK2001: unresolved external symbol "public: virtual void __cdecl XAMLDirect3DGame::App::[Windows::UI::Xaml::IApplicationOverrides]::OnLaunched(class Windows::ApplicationModel::Activation::LaunchActivatedEventArgs ^)" (?OnLaunched@?QIApplicationOverrides@Xaml@UI@Windows@@App@XAMLDirect3DGame@@U$AAAXP$AAVLaunchActivatedEventArgs@Activation@ApplicationModel@4@@Z) C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\XAMLDirect3DApp\XamlTypeInfo.g.obj
    Error 3 error LNK2019: unresolved external symbol "public: virtual void __cdecl XAMLDirect3DGame::App::[XAMLDirect3DGame::__IAppPublicNonVirtuals]::ResetGame(void)" (?ResetGame@?Q__IAppPublicNonVirtuals@XAMLDirect3DGame@@App@2@U$AAAXXZ) referenced in function "public: virtual long __stdcall XAMLDirect3DGame::App::[XAMLDirect3DGame::__IAppPublicNonVirtuals]::__abi_XAMLDirect3DGame___IAppPublicNonVirtuals____abi_ResetGame(void)" (?__abi_XAMLDirect3DGame___IAppPublicNonVirtuals____abi_ResetGame@?Q__IAppPublicNonVirtuals@XAMLDirect3DGame@@App@2@U$AAGJXZ) C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\XAMLDirect3DApp\App.xaml.obj
    Error 4 error LNK2001: unresolved external symbol "public: virtual void __cdecl XAMLDirect3DGame::App::[XAMLDirect3DGame::__IAppPublicNonVirtuals]::ResetGame(void)" (?ResetGame@?Q__IAppPublicNonVirtuals@XAMLDirect3DGame@@App@2@U$AAAXXZ) C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\XAMLDirect3DApp\XamlTypeInfo.g.obj
    Error 5 error LNK2019: unresolved external symbol "public: virtual void __cdecl XAMLDirect3DGame::App::[XAMLDirect3DGame::__IAppPublicNonVirtuals]::SetBackground(unsigned int)" (?SetBackground@?Q__IAppPublicNonVirtuals@XAMLDirect3DGame@@App@2@U$AAAXI@Z) referenced in function "public: virtual long __stdcall XAMLDirect3DGame::App::[XAMLDirect3DGame::__IAppPublicNonVirtuals]::__abi_XAMLDirect3DGame___IAppPublicNonVirtuals____abi_SetBackground(unsigned int)" (?__abi_XAMLDirect3DGame___IAppPublicNonVirtuals____abi_SetBackground@?Q__IAppPublicNonVirtuals@XAMLDirect3DGame@@App@2@U$AAGJI@Z) C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\XAMLDirect3DApp\App.xaml.obj
    Error 6 error LNK2001: unresolved external symbol "public: virtual void __cdecl XAMLDirect3DGame::App::[XAMLDirect3DGame::__IAppPublicNonVirtuals]::SetBackground(unsigned int)" (?SetBackground@?Q__IAppPublicNonVirtuals@XAMLDirect3DGame@@App@2@U$AAAXI@Z) C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\XAMLDirect3DApp\XamlTypeInfo.g.obj
    Error 7 error LNK2019: unresolved external symbol "public: virtual void __cdecl XAMLDirect3DGame::App::[XAMLDirect3DGame::__IAppPublicNonVirtuals]::CycleBackground(void)" (?CycleBackground@?Q__IAppPublicNonVirtuals@XAMLDirect3DGame@@App@2@U$AAAXXZ) referenced in function "public: virtual long __stdcall XAMLDirect3DGame::App::[XAMLDirect3DGame::__IAppPublicNonVirtuals]::__abi_XAMLDirect3DGame___IAppPublicNonVirtuals____abi_CycleBackground(void)" (?__abi_XAMLDirect3DGame___IAppPublicNonVirtuals____abi_CycleBackground@?Q__IAppPublicNonVirtuals@XAMLDirect3DGame@@App@2@U$AAGJXZ) C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\XAMLDirect3DApp\App.xaml.obj
    Error 8 error LNK2001: unresolved external symbol "public: virtual void __cdecl XAMLDirect3DGame::App::[XAMLDirect3DGame::__IAppPublicNonVirtuals]::CycleBackground(void)" (?CycleBackground@?Q__IAppPublicNonVirtuals@XAMLDirect3DGame@@App@2@U$AAAXXZ) C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\XAMLDirect3DApp\XamlTypeInfo.g.obj
    Error 9 error LNK2019: unresolved external symbol "public: virtual void __cdecl XAMLDirect3DGame::App::[XAMLDirect3DGame::__IAppPublicNonVirtuals]::ResetLicense(void)" (?ResetLicense@?Q__IAppPublicNonVirtuals@XAMLDirect3DGame@@App@2@U$AAAXXZ) referenced in function "public: virtual long __stdcall XAMLDirect3DGame::App::[XAMLDirect3DGame::__IAppPublicNonVirtuals]::__abi_XAMLDirect3DGame___IAppPublicNonVirtuals____abi_ResetLicense(void)" (?__abi_XAMLDirect3DGame___IAppPublicNonVirtuals____abi_ResetLicense@?Q__IAppPublicNonVirtuals@XAMLDirect3DGame@@App@2@U$AAGJXZ) C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\XAMLDirect3DApp\App.xaml.obj
    Error 10 error LNK2001: unresolved external symbol "public: virtual void __cdecl XAMLDirect3DGame::App::[XAMLDirect3DGame::__IAppPublicNonVirtuals]::ResetLicense(void)" (?ResetLicense@?Q__IAppPublicNonVirtuals@XAMLDirect3DGame@@App@2@U$AAAXXZ) C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\XAMLDirect3DApp\XamlTypeInfo.g.obj
    Error 11 error LNK2019: unresolved external symbol "private: __cdecl XAMLDirect3DGame::App::~App(void)" (??1App@XAMLDirect3DGame@@A$AAA@XZ) referenced in function "public: virtual void __cdecl XAMLDirect3DGame::App::[Platform::IDisposable]::<Dispose>(void)" (?<Dispose>@?QIDisposable@Platform@@App@XAMLDirect3DGame@@U$AAAXXZ) C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\XAMLDirect3DApp\App.xaml.obj
    Error 12 error LNK2001: unresolved external symbol "private: __cdecl XAMLDirect3DGame::App::~App(void)" (??1App@XAMLDirect3DGame@@A$AAA@XZ) C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\XAMLDirect3DApp\XamlTypeInfo.g.obj
    Error 13 error LNK2019: unresolved external symbol "?main@@YAHP$01$AAV?$Array@P$AAVString@Platform@@$00@Platform@@@Z" (?main@@YAHP$01$AAV?$Array@P$AAVString@Platform@@$00@Platform@@@Z) referenced in function "int __cdecl _main(void)" (?_main@@YAHXZ) C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\XAMLDirect3DApp\vccorlibd.lib(climain.obj)
    Error 14 error LNK1120: 7 unresolved externals C:\Users\Srinath\Documents\Visual Studio 2012\Projects\XAMLDirect3DApp\Debug\XAMLDirect3DApp\XAMLDirect3DApp.exe

    • Moved by Jesse Jiang Thursday, August 9, 2012 7:18 AM (From:Visual C++ General)
    Monday, August 6, 2012 4:35 PM

Answers