Looking to learn how to get started

Started by Cipherpunk, September 18, 2017, 11:21:48 PM

Previous topic - Next topic
Hello all, my name is Christopher and I'm interested in contributing to Solarus. I've already cloned the repository to my PC but I've been struggling for the last day or so to follow the compilation instructions. I've never developed for an existing C++ code base before but I do have a bit of experience building very small hobby projects with Visual Studio. I'm mostly struggling with how to get the libraries installed once I've located them and how to setup the project itself with flags for the compiler and such. Would a patient teacher from this community be willing to show me how to get started?

I realize that I'm only going to get out of this as much as I put into it. So, I'll just post my progress here and think out loud for now.

I've abandoned trying to set this up in Visual Studio because...Visual Studio. I got Code::Blocks installed and added all of the files from include and src recursively. I never realized that was different from just copying the folders into a project. I was also able to add the NDEBUG to the compiler defines for the release version, simple enough. I also managed to install mingw32 and point CB to that for all the compiler options (I think). I'm planning to just start building this thing without the libraries and add them one at a time as it complains at me (although, I have no idea what .lib I'm supposed to use for mingw32).

At first, CB was telling me that it couldn't find any of the header files and I think it's because their location wasn't in my path. So I added the path explicitly for this project but I'm sure there's probably an easier way to do that. Now it's complaining that it can't find config.h and, indeed, I don't see that file anywhere in the include or source folders. I do see a config.h.in but I'm not sure yet if that's the same thing.

This is definitely rough city but I know it will be worth it. I'll post more updates on my progress.

Compiling with Windows is a pain, yes.
We use CMake to configure everything. CMake detects the headers and libraries (and complains if some are missing), sets appropriate flags like NDEBUG, generates config.h and can generate a valid CodeBlocks project.
It is also possible to create the projet by hand like you do. But you need to create a valid config.h file manually.

Anyway, with or without CMake you won't avoid the hardest part: installing all necessary headers and libraries.

Here you can get the ones that are hard to find or that are not provided as binaries by their websites: https://github.com/solarus-games/solarus/tree/dev/libraries/win32/lib. They are all compatible with Mingw32, I don't know if they would work with Visual Studio but they do work with the Mingw32 compiler you have with CodeBlocks.

I hope it helps!

I am making very good progress on this now! I would much prefer to use CMake but I had to learn how use that first. Now I'm trying to install all the libraries and I'm knocking them out, one at a time. Just a couple more left and hopefully I'll be up and running tonight. Thank you, Christopho! I'm Christopher btw.  :D

I've finally managed to start generating a CB project. I'm trying to build it but I'm getting an error that says "fatal error: stdlib.h: No such file or directory". At first, I thought I might fix it by just adding that folder to my path but it's already in my path. It's in the same folder as cstdlib, which is where the error is coming from. I'm kind of at a loss here. I did some googling and I'm finding all kinds of potential causes and fixes but nothing seems to work so far. The only thing I can think is that there's an empty entry in CMake called DL_Library. I'm not sure which, if any, path I need here.