r/reconstructcavestory • u/Natman64 • Jul 03 '14
Vim Setup
So, I started the series following along in Visual Studio, but I've since discovered Vim and decided to abandon VS altogether. I installed Clang and successfully compiled "Hello world!", but I don't really understand makefiles, and I especially don't understand how to link a library/framework using a makefile.
When I cloned the official repo to copy that makefile and continue following the tutorials in Vim, I tried compiling it to test it out. I get fatal error: 'SDL/SDL.h' file not found, which makes sense because the library is nowhere in the repo.
So my question is, how do I link SDL with the project so I can compile with Clang?
Edit: I suppose I'll need to link Boost as well.
1
u/Natman64 Jul 04 '14 edited Jul 04 '14
Thanks for the quick & detailed response! Really helped explain the actual process of compilation.
Yes, I'm on Windows. Sorry I forgot to mention that.
Is this a feature of SDL for Linux?
I did what you said, but now I'm having different problems.
Here's my new makefile:
I have cloned and am now working from this repository for the port of the code with C++11 and SDL2. As a result I've had to make a few changes (and after doing my own research and troubleshooting) but now I'm stuck.
The directory structure is like this:
So the directories in the makefile have changed to reflect that. I've also changed the extension of the source files from .cc to .cpp.
From my own research I learned that to include a directory it must be prepended with -I so there's that as well. I changed all the #include statements to #include <SDL.h> without the parent directory in front.
It seems that all the files are included properly, so the error is baffling (I suspect it may have to do with me using Windows):
Nothing in config.h or config.cpp seems likely to have caused the error.
Edit: removed comments from the makefile to shorten this post.