Getting SDL downloaded and installed

Started by
6 comments, last by Soilborn 10 years, 5 months ago

I'm sort of at the point where I'm tearing my hair out over this one. I have Microsoft Visual Studio Express 2012 and I'm trying to get started working with SDL 2.0. My problem is that I'm not finding any complete tutorials.

I've found a great guide for setting it up here, but I tried compiling it and I get the error "LNK1104: cannot open file SDL.lib" Huh. I put a copy of the file where I was told to, as well as in every other folder. I also get the warning "LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library." No idea what this means.

I am determined that my problem is that I don't know WHAT I need to download. I originally got the source code and found much of what I needed missing. I got and combined the runtime binaries and dev libraries, and that's what I'm working with now. But following this experiment, I'm not even sure of that. Help? Please? I really want to move on and learn to use SDL.

Advertisement

Well, you're trying to use SDL 2.0, so you should be trying to open SDL2.lib.

It's yelling at me saying "The program can't start because SDL2.dll is missing from your computer. Try reinstalling the program to fix this problem." =\



It's yelling at me saying "The program can't start because SDL2.dll is missing from your computer. Try reinstalling the program to fix this problem." =\

From your tutorial:

Before we can run this program we’ll need to copy the SDL binary into our executable’s directory. SDL2.dll can be found in the lib directory of your SDL folder under lib/(x86/x64), use the one for the architecture you linked against.



It's yelling at me saying "The program can't start because SDL2.dll is missing from your computer. Try reinstalling the program to fix this problem." =\

From your tutorial:

Before we can run this program we’ll need to copy the SDL binary into our executable’s directory. SDL2.dll can be found in the lib directory of your SDL folder under lib/(x86/x64), use the one for the architecture you linked against.

In my original post I'd pointed out that I'd already done that and, in fact, put a copy in every folder of the project. Maybe it's because my code isn't creating an executable when I run it?

I had mIssing DLL errors which turned out to be due to me installing the 64bit versions, and not realising my compiler was 32bit. Do you remember which version you extracted, cause they're not clearly named.


In my original post I'd pointed out that I'd already done that and, in fact, put a copy in every folder of the project. Maybe it's because my code isn't creating an executable when I run it?

No...


I've found a great guide for setting it up here, but I tried compiling it and I get the error "LNK1104: cannot open file SDL.lib" Huh. I put a copy of the file where I was told to, as well as in every other folder. I also get the warning "LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library." No idea what this means.

You said you put a copy of SDL.lib in every folder. I said that you do not have SDL2.dll in the right place.

Ah Pink Horror, I think I know where our complexities arise. I said it was looking for SDL.lib, and then said I put a copy of the file where i was told to. It seems you thought I meant that I had copied SDL2.lib, when what I meant was SLD2.dll. My apologies, I should have been more clear.

Okay, so I tried setting things up again from scratch, same process. For some odd reason it seems to work fine. The first time I ran the simple program given in the tutorial it gave me a directex error. It ran in Avast Sandbox mode though which, though happy with it, terminated the application before I could get the error code. Every time I've run the program since it works without a hitch.

I think my problem is that I have two Program Files folders, "Program Files" and "Program Files (x86)". This seems like it was likely the root of the problem. Before I retried the tutorial I moved my libraries and includes from the later to the former. I think Visual Studio just didn't like the "(x86)" part of the folder name.

I was also getting a warning under my error list the second or third time I launched the tutorial application, but it's since vanished from subsequent executions. I think I'm good to go. Thanks anyway, Pink Horror! I'd hug you if I could.

This topic is closed to new replies.

Advertisement