How do I link DirectX9 to MS VC++ 6.0

This is a discussion on How do I link DirectX9 to MS VC++ 6.0 within the C++ Programming forums, part of the General Programming Boards category; I am getting linker errors as shown below. demo6_3.obj : error LNK2001: unresolved external symbol _DirectDrawCreateEx@16 LIBCD.lib(crt0.obj) : error LNK2001: ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    3

    How do I link DirectX9 to MS VC++ 6.0

    I am getting linker errors as shown below.

    demo6_3.obj : error LNK2001: unresolved external symbol _DirectDrawCreateEx@16
    LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debug/demo6_3.exe : fatal error LNK1120: 2 unresolved externals
    Error executing link.exe.

    I am using VC++ 6.0 and installed DirectX9 into C:\DXSDK. Dpes anyone know where I can find directions to make sure I am setting the program up right to link properly.
    Below is code that is neede too link to DirectDraw but I don't know if its right or not. This is an example from a book. The exe works.

    ------------------------------------------------------------------------------
    LPDIRECTDRAW7 lpdd = NULL; // dd object
    LPDIRECTDRAWSURFACE7 lpddsprimary = NULL; // dd primary surface
    LPDIRECTDRAWSURFACE7 lpddsback = NULL; // dd back surface
    LPDIRECTDRAWPALETTE lpddpal = NULL; // a pointer to the created dd palette
    LPDIRECTDRAWCLIPPER lpddclipper = NULL; // dd clipper
    PALETTEENTRY palette[256]; // color palette
    PALETTEENTRY save_palette[256]; // used to save palettes
    DDSURFACEDESC2 ddsd; // a direct draw surface description struct
    DDBLTFX ddbltfx; // used to fill
    DDSCAPS2 ddscaps; // a direct draw surface capabilities struct
    HRESULT ddrval; // result back from dd calls
    DWORD start_clock_count = 0; // used for timing

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    Project->Settings->Link Tab

    Add ddraw.lib and dxguid.lib to the Object/Library Modules section.

  3. #3
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    Posts
    1,380
    Looks like your entry point is wrong too. Make sure your project is set to compile as a Windows Application.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MS Visual Studio 6.0
    By overspray in forum Windows Programming
    Replies: 2
    Last Post: 07-26-2003, 06:56 PM
  2. Can't compile this with VC 6.0
    By uriel2013 in forum C++ Programming
    Replies: 4
    Last Post: 05-31-2003, 07:43 PM
  3. Visual Studio 6.0 Help
    By L_I_Programmer in forum C++ Programming
    Replies: 1
    Last Post: 03-24-2003, 09:35 PM
  4. adding a header file in VC 6.0
    By stimpyzu in forum C++ Programming
    Replies: 5
    Last Post: 10-28-2002, 01:26 AM
  5. VC 6.0 compiled error
    By alan4100 in forum Windows Programming
    Replies: 4
    Last Post: 09-17-2001, 03:10 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21