Thread: debug to release modes

  1. #1
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743

    Question debug to release modes

    I switched my compiling options in MSVC++ to compile in release mode instead of debug mode.

    When it was compiling in debug mode, in compiled completely okay, but then when I just switched it to release mode, it suddenly gave me 40 linking errors.

    They are below if you feel like looking at them...

    but anyways, why did it just suddenly start giving me linking errors just by switching from debug mode to release mode???

    Code:
    Compiling...
    main.cpp
    Linking...
    main.obj : error LNK2001: unresolved external symbol _gluPerspective@32
    main.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
    main.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
    main.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
    main.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
    main.obj : error LNK2001: unresolved external symbol __imp__glShadeModel@4
    main.obj : error LNK2001: unresolved external symbol __imp__glEnable@4
    main.obj : error LNK2001: unresolved external symbol _SDL_PollEvent
    main.obj : error LNK2001: unresolved external symbol __imp__glDisable@4
    main.obj : error LNK2001: unresolved external symbol _SDL_EnableKeyRepeat
    main.obj : error LNK2001: unresolved external symbol _SDL_Quit
    main.obj : error LNK2001: unresolved external symbol _SDL_SetVideoMode
    main.obj : error LNK2001: unresolved external symbol _SDL_GL_SetAttribute
    main.obj : error LNK2001: unresolved external symbol _SDL_Init
    main.obj : error LNK2001: unresolved external symbol _SDL_GL_SwapBuffers
    main.obj : error LNK2001: unresolved external symbol __imp__glTranslatef@12
    main.obj : error LNK2001: unresolved external symbol __imp__glRotatef@16
    main.obj : error LNK2001: unresolved external symbol __imp__glClear@4
    main.obj : error LNK2001: unresolved external symbol _auxDIBImageLoadA@4
    main.obj : error LNK2001: unresolved external symbol __imp__glTexImage2D@36
    main.obj : error LNK2001: unresolved external symbol __imp__glBindTexture@8
    main.obj : error LNK2001: unresolved external symbol __imp__glGenTextures@8
    main.obj : error LNK2001: unresolved external symbol __imp__glTexParameteri@12
    main.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
    main.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
    main.obj : error LNK2001: unresolved external symbol __imp__glColor3f@12
    main.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
    main.obj : error LNK2001: unresolved external symbol __imp__glTexCoord2f@8
    main.obj : error LNK2001: unresolved external symbol __imp__glEndList@0
    main.obj : error LNK2001: unresolved external symbol __imp__glTranslated@24
    main.obj : error LNK2001: unresolved external symbol __imp__glNewList@8
    main.obj : error LNK2001: unresolved external symbol __imp__glVertex2i@8
    main.obj : error LNK2001: unresolved external symbol __imp__glGenLists@4
    main.obj : error LNK2001: unresolved external symbol __imp__glDeleteLists@8
    main.obj : error LNK2001: unresolved external symbol __imp__glPopMatrix@0
    main.obj : error LNK2001: unresolved external symbol __imp__glCallLists@12
    main.obj : error LNK2001: unresolved external symbol __imp__glListBase@4
    main.obj : error LNK2001: unresolved external symbol __imp__glOrtho@48
    main.obj : error LNK2001: unresolved external symbol __imp__glPushMatrix@0
    LIBC.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
    Release/RTS Practice.exe : fatal error LNK1120: 40 unresolved externals
    Error executing link.exe.
    
    RTS Practice.exe - 41 error(s), 0 warning(s)
    My Website

    "Circular logic is good because it is."

  2. #2
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    nevermind i figured it out
    My Website

    "Circular logic is good because it is."

  3. #3
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    get used to this, and realize now that some debuggers somehow runs your code differently than a std run, i hate that... you have to debug for both...
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    The debug and release modes use separate include lists (libraries and such), so if you include some files in one mode then switch to the other you have to include them again. Has happened to me before, and it took some time until I figured that out.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  5. #5
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    I make this mistake constantly. You're not alone.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  6. #6
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    New York
    Posts
    1,905
    it took me a few days to figure out that you have to include the libraries in both modes don't feel too left out

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, 04:39 PM
  2. makefiles - debug & release?
    By cpjust in forum C Programming
    Replies: 6
    Last Post: 10-26-2007, 04:00 PM
  3. Results in Debug and Release mode are different
    By jaro in forum C Programming
    Replies: 11
    Last Post: 05-27-2006, 11:08 AM
  4. Release vs. Debug mode builds
    By earth_angel in forum C++ Programming
    Replies: 5
    Last Post: 11-10-2005, 04:41 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, 04:43 PM