I’m using MinGW on Windows 7.
Put simply, I want to create a Hello World SDL program (initiate a window or something simple), and compile it so that I have a standalone program that I can distribute without, say, users having to install anything extra (like putting SDL.dll in the Windows folder).
- I’ve downloaded the SDL development library, which is currently
sitting inc:\SDL. - In my project folder I’ve got
test.cppandSDL.dll
I’m not too sure what to do next; I thought at first I would be able to include SDL and then just link to the DLL in the commandline and voila, but perhaps it would seem I need to compile the SDL development library with my program first? My only goal is to have my SDL program wrapped up in a folder that I can distribute to other Windows platforms without the requirement that they have to install anything extra – or would they definitely need to install SDL.dll in the Windows folder?
EDIT: Further clarification – could someone describe the steps that I’d take to do this? I mean, what would a developer looking to distribute his application do? Do most game installers actually put .dll files in the Windows folder when applications like this are installed?
Source (test.cpp):
#include <SDL/SDL.h>
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
Folder:
test.cpp
SDL.dll
Commandline:
g++ test.cpp -lSDL
Output:
test.cpp:2:17: fatal error: SDL.h: No such file or directory
compilation terminated
Yes, pretty much that’s it.
What? Unless you’re developing for an embedded system, there’s no separate “development” library. You link against the very same DLL that will be loaded when your program is started.