IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

DirectX Discussion :

erreur link avec Builder C++


Sujet :

DirectX

  1. #1
    Membre à l'essai
    Inscrit en
    Juillet 2002
    Messages
    18
    Détails du profil
    Informations forums :
    Inscription : Juillet 2002
    Messages : 18
    Points : 16
    Points
    16
    Par défaut erreur link avec Builder C++
    Bonjour,
    kelk1 connait cette erreur, avec l'init de directx9?
    Unresolved external 'Direct3DCreate9' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\DX_2\PROJECT2.OBJ

    pourtant G bien dans Option projet , voir Borland Lib-DXSDK/Lib-DXSDK/INCLUDE

    Merci...
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    //-----------------------------------------------------------------------------
    // File: CreateDevice.cpp
    //
    // Desc: This is the first tutorial for using Direct3D. In this tutorial, all
    //       we are doing is creating a Direct3D device and using it to clear the
    //       window.
    //
    // Copyright (c) Microsoft Corporation. All rights reserved.
    //-----------------------------------------------------------------------------
    #include <d3d9.h>
     
     
     
     
    //-----------------------------------------------------------------------------
    // Global variables
    //-----------------------------------------------------------------------------
    LPDIRECT3D9             g_pD3D       = NULL; // Used to create the D3DDevice
    LPDIRECT3DDEVICE9       g_pd3dDevice = NULL; // Our rendering device
     
     
     
     
    //-----------------------------------------------------------------------------
    // Name: InitD3D()
    // Desc: Initializes Direct3D
    //-----------------------------------------------------------------------------
    HRESULT InitD3D( HWND hWnd )
    {
        // Create the D3D object, which is needed to create the D3DDevice.
        if( NULL == ( g_pD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) )
            return E_FAIL;
     
        // Set up the structure used to create the D3DDevice. Most parameters are
        // zeroed out. We set Windowed to TRUE, since we want to do D3D in a
        // window, and then set the SwapEffect to "discard", which is the most
        // efficient method of presenting the back buffer to the display.  And 
        // we request a back buffer format that matches the current desktop display 
        // format.
        D3DPRESENT_PARAMETERS d3dpp; 
        ZeroMemory( &d3dpp, sizeof(d3dpp) );
        d3dpp.Windowed = TRUE;
        d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
        d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
     
        // Create the Direct3D device. Here we are using the default adapter (most
        // systems only have one, unless they have multiple graphics hardware cards
        // installed) and requesting the HAL (which is saying we want the hardware
        // device rather than a software one). Software vertex processing is 
        // specified since we know it will work on all cards. On cards that support 
        // hardware vertex processing, though, we would see a big performance gain 
        // by specifying hardware vertex processing.
        if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
                                          D3DCREATE_SOFTWARE_VERTEXPROCESSING,
                                          &d3dpp, &g_pd3dDevice ) ) )
        {
            return E_FAIL;
        }
     
        // Device state would normally be set here
     
        return S_OK;
    }
     
     
     
     
    //-----------------------------------------------------------------------------
    // Name: Cleanup()
    // Desc: Releases all previously initialized objects
    //-----------------------------------------------------------------------------
    VOID Cleanup()
    {
        if( g_pd3dDevice != NULL) 
            g_pd3dDevice->Release();
     
        if( g_pD3D != NULL)
            g_pD3D->Release();
    }
     
     
     
     
    //-----------------------------------------------------------------------------
    // Name: Render()
    // Desc: Draws the scene
    //-----------------------------------------------------------------------------
    VOID Render()
    {
        if( NULL == g_pd3dDevice )
            return;
     
        // Clear the backbuffer to a blue color
        g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,255), 1.0f, 0 );
     
        // Begin the scene
        if( SUCCEEDED( g_pd3dDevice->BeginScene() ) )
        {
            // Rendering of scene objects can happen here
     
            // End the scene
            g_pd3dDevice->EndScene();
        }
     
        // Present the backbuffer contents to the display
        g_pd3dDevice->Present( NULL, NULL, NULL, NULL );
    }
     
     
     
     
    //-----------------------------------------------------------------------------
    // Name: MsgProc()
    // Desc: The window's message handler
    //-----------------------------------------------------------------------------
    LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
    {
        switch( msg )
        {
            case WM_DESTROY:
                Cleanup();
                PostQuitMessage( 0 );
                return 0;
     
            case WM_PAINT:
                Render();
                ValidateRect( hWnd, NULL );
                return 0;
        }
     
        return DefWindowProc( hWnd, msg, wParam, lParam );
    }
     
     
     
     
    //-----------------------------------------------------------------------------
    // Name: WinMain()
    // Desc: The application's entry point
    //-----------------------------------------------------------------------------
    INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )
    {
        // Register the window class
        WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L, 
                          GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
                          "D3D Tutorial", NULL };
        RegisterClassEx( &wc );
     
        // Create the application's window
        HWND hWnd = CreateWindow( "D3D Tutorial", "D3D Tutorial 01: CreateDevice", 
                                  WS_OVERLAPPEDWINDOW, 100, 100, 300, 300,
                                  GetDesktopWindow(), NULL, wc.hInstance, NULL );
     
        // Initialize Direct3D
        if( SUCCEEDED( InitD3D( hWnd ) ) )
        { 
            // Show the window
            ShowWindow( hWnd, SW_SHOWDEFAULT );
            UpdateWindow( hWnd );
     
            // Enter the message loop
            MSG msg; 
            while( GetMessage( &msg, NULL, 0, 0 ) )
            {
                TranslateMessage( &msg );
                DispatchMessage( &msg );
            }
        }
     
        UnregisterClass( "D3D Tutorial", wc.hInstance );
        return 0;
    }

  2. #2
    Rédacteur
    Avatar de Laurent Gomila
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2003
    Messages
    10 651
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2003
    Messages : 10 651
    Points : 15 920
    Points
    15 920
    Par défaut
    Tu as sûrement oublié de lier avec d3d9.lib

  3. #3
    Membre à l'essai
    Inscrit en
    Juillet 2002
    Messages
    18
    Détails du profil
    Informations forums :
    Inscription : Juillet 2002
    Messages : 18
    Points : 16
    Points
    16
    Par défaut
    slt,
    malheureusement, l'erreur persiste, malgrè d3d9.lib visible pour le link.
    Est-ce une histoire d'ordre de priorité, car j'ai d3d9.lib dans DXSDK/lib et DXSDK/Borland lib (lib de Borland pour DirectX)

    Help... Thx

  4. #4
    Rédacteur
    Avatar de Laurent Gomila
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2003
    Messages
    10 651
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2003
    Messages : 10 651
    Points : 15 920
    Points
    15 920
    Par défaut
    Il ne suffit pas d'avoir les bons fichiers dans les bons répertoires, il faut les ajouter à tes options lors de l'édition de liens de ton programme.

  5. #5
    Membre à l'essai
    Inscrit en
    Juillet 2002
    Messages
    18
    Détails du profil
    Informations forums :
    Inscription : Juillet 2002
    Messages : 18
    Points : 16
    Points
    16
    Par défaut
    Slt,
    Tout a fait loulou24, c de la boite option que je parle. des boites options meme, Projet et environnement...
    par contre je me suis rendu compte que j'en avais 2, un dans BorlandLib et l'autre dans DXSDK/lib, et non pas le meme poids, donc different certainement.
    G mis les deux visibles, c la meme, ERROR...

  6. #6
    Rédacteur
    Avatar de Laurent Gomila
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2003
    Messages
    10 651
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2003
    Messages : 10 651
    Points : 15 920
    Points
    15 920
    Par défaut
    Salut

    Est-ce que tu as essayé les 2 fichiers l'un après l'autre ? Est-ce que tu as les bonnes versions ?

  7. #7
    Membre à l'essai
    Inscrit en
    Juillet 2002
    Messages
    18
    Détails du profil
    Informations forums :
    Inscription : Juillet 2002
    Messages : 18
    Points : 16
    Points
    16
    Par défaut
    checking version...

  8. #8
    Membre à l'essai
    Inscrit en
    Juillet 2002
    Messages
    18
    Détails du profil
    Informations forums :
    Inscription : Juillet 2002
    Messages : 18
    Points : 16
    Points
    16
    Par défaut
    Erreur tjrs, la miZere.
    En mettant l'un sans l'autre, l'autre sans l'un, l'un avant l'autre,l'autre avant l'un, tjrs erreur du lieur.

    BorlandLib et Borland DLL recuperer ici
    http://oconstans.developpez.com/tuto..._DX90_libs.zip

    http://oconstans.developpez.com/tuto..._DX90_dlls.zip


    je m'aide de ce tutorial
    http://oconstans.developpez.com/tuto.../dx9cBuilder6/

    Kestion compile des demos, je suis Ok pourtant...
    C space.
    Merci for Help...

  9. #9
    Membre à l'essai
    Inscrit en
    Juillet 2002
    Messages
    18
    Détails du profil
    Informations forums :
    Inscription : Juillet 2002
    Messages : 18
    Points : 16
    Points
    16
    Par défaut
    slt, c bon ca fonctionne, en fait j'ai pris le tutorial et l'ai converti en version builder et ca compile sans soucis.

    THx For HELP...

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Erreur link c++ builder: lib introuvable
    Par yukafrisbee dans le forum C++Builder
    Réponses: 3
    Dernier message: 15/12/2011, 11h38
  2. Erreur link avec C++ Builder 2010
    Par TsCyrille dans le forum C++Builder
    Réponses: 5
    Dernier message: 08/04/2010, 21h54
  3. [STL] Erreur au link avec VC++ et Pocket PC 2003
    Par Slayne dans le forum Mobiles
    Réponses: 2
    Dernier message: 24/08/2007, 11h45
  4. Erreur de link avec les templates
    Par suiss007 dans le forum C++
    Réponses: 6
    Dernier message: 04/01/2007, 11h09
  5. Erreurs de link avec fenêtres win32
    Par crossbowman dans le forum Windows
    Réponses: 4
    Dernier message: 21/02/2006, 01h08

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo