1

Iam modding in the source Engine and iam trying to add adobe Flash into it i have already included header files and the libs from Microsoft DirectX SDK (June 2010) in visual studio 2010 but when Compiling the project it give me errors

1>FlashManager.obj : error LNK2019: unresolved external symbol _D3DXCreateSprite@8 referenced in function "public: bool __thiscall FlashManager::RecreateTargets(struct IDirect3DDevice9 *)" (?RecreateTargets@FlashManager@@QAE_NPAUIDirect3DDevice9@@@Z)
1>FlashManager.obj : error LNK2019: unresolved external symbol _D3DXMatrixTransformation2D@28 referenced in function "public: void __thiscall FlashManager::SceneDataHook(void)" (?SceneDataHook@FlashManager@@QAEXXZ)
1>FlashManager.obj : error LNK2019: unresolved external symbol "struct IFlashDX * __cdecl GetFlashToDirectXInstance(void)" (?GetFlashToDirectXInstance@@YAPAUIFlashDX@@XZ) referenced in function "public: __thiscall FlashManager::FlashManager(void)" (??0FlashManager@@QAE@XZ)
1>.\Release_sdk\Client.dll : fatal error LNK1120: 3 unresolved externals

How Can i fix it linked every thing

The code

bool FlashManager::RecreateTargets(IDirect3DDevice9* pD3DDevice)
{
    HRESULT hr;

    int movieIndex = GetPlayingMovieIndex();
    int newWidth = -1, newHeight = -1;

    if (movieIndex > -1)
    {
        newWidth = m_movieArray[movieIndex].GetWidth();
        newHeight = m_movieArray[movieIndex].GetHeight();
    }
    else
    {
        newWidth = w;
        newHeight = h;
    }

    hr = pD3DDevice->CreateTexture(newWidth, newHeight, 1, 0, transparency_mode ? D3DFMT_A8R8G8B8 : D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &g_Texture, NULL);
    if (FAILED(hr))
        return false;

    D3DXCreateSprite(pD3DDevice, &Sprite); //the problem
    g_pD3DDevice = pD3DDevice;

    if (m_flashPlayer)
        m_flashPlayer->ResizePlayer(newWidth, newHeight);

    for (int i = 0; i < num_textures_in_rotation; ++i)
    {
        hr = pD3DDevice->CreateTexture(newWidth, newHeight, 1, 0,
            transparency_mode ? D3DFMT_A8R8G8B8 : D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM, &g_texturesRotation[i], NULL);

        if (FAILED(hr))
            return false;
    }

    recreatedTargets = true;

    return true;
}

Link error 2

        D3DXMatrixTransformation2D(&Mat, NULL, 0, &Scaling, NULL, 0, &Translation);   // The problem

The Last link error

FlashManager::FlashManager()
{
    engine->GetScreenSize(w, h);

    // Flash init
    m_flashDX = GetFlashToDirectXInstance();   //the problem
    m_flashPlayer = m_flashDX->CreatePlayer(w, h);

    if (!m_flashPlayer)
    {
        MessageBox(NULL, "Flash Player failed to initialize.", "Error", MB_OK);
        abort();
    }

    m_playerASI = new ASInterface(m_flashPlayer);
T0bi
  • 11
  • 3
  • 2
    Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Danh Jan 13 '17 at 11:00
  • You probably forgot to link to the `D3dx9.lib` library. – Jabberwocky Jan 13 '17 at 11:10
  • Yeap I already added it in VC++ Directories --> Library Directories – T0bi Jan 13 '17 at 11:23

0 Answers0