Linker error in release but not debug

This is a discussion on Linker error in release but not debug within the Game Programming forums, part of the General Programming Boards category; I'm getting Linker error LNK2001 when compiling my first DirectX app as Win32 Release, although it compiles fine under Win32 ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121

    Linker error in release but not debug

    I'm getting Linker error LNK2001 when compiling my first DirectX app as Win32 Release, although it compiles fine under Win32 Debug, the project type is Win32 Application (Using MSVC++6.0 standard).

    DirectDrawSprites.obj : error LNK2001: unresolved external symbol _DirectDrawCreateEx@16
    DirectDrawSprites.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw7
    Release/Step2.exe : fatal error LNK1120: 2 unresolved externals

    Most of the code is from a tutorial on www.sunlightd.com, slightly modified, it's attached to this post.

    Thanks in advance fort any help
    Attached Files Attached Files

  2. #2
    Unregistered
    Guest
    I get linker errors as well, stupid MSVC, its compiled fine so if the compiler can find the files for your functions why can't the linker.
    If the source files for those functions wasn't there the compiler would give an error message saying undeclared identifier which it dosen't. I've looked under project settings in MSVC but it isn't obvious whats going on there. Also I've searched msdn webpage for documents about how to use MSVC, guess what nothing there, in fact its even more vague than the help you get with MSVC.
    If I ever do find documents on using MSVC Ill post them.

  3. #3
    Bobish
    Guest
    this is just a guess but are you including all the lib file necessary

  4. #4
    Registered User
    Join Date
    Aug 2001
    Posts
    411
    I dont have the SDK, so i cant compile the code, but that would be my guess also. The .libs are not linking. Release and Debug have two seperate setups in msvc. Look to the upper left corner of the Project->Settings Dialog.

  5. #5
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    Thanks! Yeah the DirectX libs were'nt being included under the link tab for release, but its all compiling properly now.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. debug release conf problem
    By fighter92 in forum Game Programming
    Replies: 6
    Last Post: 03-20-2009, 05:39 PM
  2. makefiles - debug & release?
    By cpjust in forum C Programming
    Replies: 6
    Last Post: 10-26-2007, 05:00 PM
  3. Results in Debug and Release mode are different
    By jaro in forum C Programming
    Replies: 11
    Last Post: 05-27-2006, 12:08 PM
  4. debug to release modes
    By DavidP in forum Game Programming
    Replies: 5
    Last Post: 03-20-2003, 03:01 PM
  5. Compiled App as release - won't run - as debug runs
    By XenoCodex Admin in forum C++ Programming
    Replies: 7
    Last Post: 08-05-2002, 05:43 PM

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