Thread: I'm having alot of trouble

  1. #1
    The Negativity. LAURENT*'s Avatar
    Join Date
    May 2012
    Posts
    68

    I'm having alot of trouble

    I've had much trouble with the SDL library. I made this in attempt to make myself more understood. From top to bottom is every step I've taken to set up the SDL library.

    looking at this, did I do anything wrong or forgot to do anything (Click to zoom in). I just want to set this up already so I can finally start coding.
    http://i1083.photobucket.com/albums/...psd7c6df1f.png

  2. #2
    Registered User
    Join Date
    Mar 2010
    Posts
    583
    Not quite -- the "Library directories" property tells MSVC where to look for static libraries (.lib) not DLLs. You should add the location of the lib files that you've named in Additional Dependencies to the Library Directories property. Static libraries are found at build (link) time, and DLLs are found at runtime.

    A program will search for DLLs as described here: Search Path Used by Windows to Locate a DLL

    I'd recommend copying the DLLs into the same directory as the executable to start with. This seems to be the least prone to problems, so is a good thing to do to make sure you've got all the necessary static and dynamic libraries. If you're going to be creating many projects that use these DLLs, it'd probably be a good plan to add the DLLs to your PATH. Then you won't have to copy them around anymore. But to be honest sometimes this seems to not work for no reason I can figure out, so best not start by doing that. Copy instead.

    According to FAQWindows - SDL Wiki you also need to specify the right sort of runtime library:

    When using Visual C++ I get link errors relating to MSVCRT.LIB or LIBC

    Quote Originally Posted by FAQ
    SDL is dynamically linked with the multi-threaded version of the Microsoft Visual C runtime. You need to edit your project settings, go to the C++ language tab, change the listbox to "Code Generation" settings, and then change the runtime library to "Multi-threaded DLL". Make sure you do this with all projects that you link into your application.
    and

    You need to pass the SDL_INIT_NOPARACHUTE flag to your calls to SDL_Init() to make the msvc debugger work.
    but that last one is just about being able to debug.

    If you can't get it working, what errors are you seeing?

  3. #3
    The Negativity. LAURENT*'s Avatar
    Join Date
    May 2012
    Posts
    68
    The build was sucessful. When I tried to debug I came across problems. When I tried to build again it tell me " 1 up to date". The only thing that happens is a box flash on the screen for about a second.


    *I set the SubSystem in linker to "windows(/SUBSYSTEM:WINDOWS)"
    *I set Run time library in Code generation to Multi-threaded DLL (/MD)
    *I put dll files in my executable with the vcxproj files.

    I'm going to read more into the links you provided. Maybe I might fix this before you reply again

    This is my error.....
    'TestingSDL.exe': Loaded 'C:\Documents and Settings\Owner\My Documents\TestingSDL\Debug\TestingSDL.exe', Symbols loaded.
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\Documents and Settings\Owner\My Documents\TestingSDL\TestingSDL\SDL.dll', Binary was not built with debug information.
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\secur32.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\user32.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\winmm.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\Documents and Settings\Owner\My Documents\TestingSDL\TestingSDL\SDL_image.dll', Binary was not built with debug information.
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\msvcp100.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\msvcr100.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\ddraw.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\dciman32.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Unloaded 'C:\WINDOWS\system32\ddraw.dll'
    'TestingSDL.exe': Unloaded 'C:\WINDOWS\system32\dciman32.dll'
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\Documents and Settings\Owner\Local Settings\Temp\IadHide4.dll', Binary was not built with debug information.
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\msctf.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\version.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Unloaded 'C:\WINDOWS\system32\version.dll'
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\msctfime.ime', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\kbdus.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Unloaded 'C:\WINDOWS\system32\kbdus.dll'
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\kbdus.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Unloaded 'C:\WINDOWS\system32\kbdus.dll'
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\dsound.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\version.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\dinput.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\hid.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\wintrust.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\crypt32.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\msasn1.dll', Cannot find or open the PDB file
    'TestingSDL.exe': Loaded 'C:\WINDOWS\system32\imagehlp.dll', Cannot find or open the PDB file
    The thread 'Win32 Thread' (0xaec) has exited with code 1 (0x1).
    The thread 'Win32 Thread' (0xb4) has exited with code 1 (0x1).
    The program '[1280] TestingSDL.exe: Native' has exited with code 1 (0x1).

  4. #4
    Registered User
    Join Date
    Mar 2010
    Posts
    583
    Hmmm. From that output it looks like the DLLs are being loaded. Don't worry about the "Cannot find or open the PDB file" diagnostics -- the PDB file relates to debugging - I'd expect to see those messages if the DLL wasn't built with debug enabled. It means you won't be able to debug inside the libraries, but it shouldn't cause a runtime failure.

    The only thing that happens is a box flash on the screen for about a second.
    Need to know why the program is failing. If you set a breakpoint at the end of main and run it it should keep the command prompt window open. Does it show any error messages? If it exits in the same way (doesn't stop on the breakpoint) then it has exited before it gets to the end of main. Then it's easiest to run the program in a command prompt and check the output.

    If there aren't any errors or diagnostics printed at runtime, then you'll probably have to debug the code and find out where it's failing. I'd expect a blocking dialog box to pop up if it was a DLL load failure, so I suspect this isn't related to failure to find DLLs.

  5. #5
    The Negativity. LAURENT*'s Avatar
    Join Date
    May 2012
    Posts
    68
    Thank you so much. With just the little you provided I was able to fix the problem. I perfer not to say what it was, it's kinda embarrassing.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 12-22-2011, 09:09 PM
  2. Replies: 2
    Last Post: 01-23-2011, 01:40 PM
  3. alot?
    By Yarin in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 07-08-2008, 07:36 PM
  4. storing alot of variables...
    By MikeyIckey in forum C Programming
    Replies: 11
    Last Post: 05-30-2008, 12:31 PM
  5. Replies: 6
    Last Post: 08-18-2002, 08:01 AM