January 30th, 2013, 09:13 PM
Stuck Building a project & MakeFile under Windows
I am learning C++, and am trying to get a project called FreeRCT (http://code.google.com/p/freerct/) running under Windows (CodeBlocks & GCC compiler) so I can tinker/learn.
The devs on this project have instructions for building this within Linux only and none use Windows. Everything hereforth is guess work on my part, I may be not making sense, but it appears to me Im on the right track. The project uses SDL and SDL_ttf. I have downloaded the source code with Tortise SVN, and had a look at the contents, there are 3 makefiles (one in the root dir, one in /rcd and one in /src) which I presume are scripts which need to be run. I believe they generate some custom data files from the graphics, and create some source code files prior to building/linking the executable (Im guessing).
I spent around 10 hours yesterday as a complete noob, trying my best to get some progress on being able to build this. Text instruction within state for Linux it requires Python and Python Imaging Library (PIL) installed to run one of the makefiles, so I installed them, updated my Windows environment PATH variables to find Python (G++.exe also). To run these makefiles, I presume I need a tool to emulate this, so I installed CygWin (with the 'make' package included), put the FreeRCT source within the CygWin\Home subfolder, ran the make command within CygWin for each makefile.
After much mucking around I was able to get the makefile to execute for '\rcd', and it appears to have executed sucessfully, and generated some custom data files.
For 'src', however, I have no idea what Im doing. I've made it to a point where it seems to be stuck getting LD.exe (G++ linker?) to find the SDL_ttf library?
The output from CygWin for the error is:
g++ -Wall -g -o freerct objects/config_reader.o objects/dates.o objects/fileio.o objects/gamelevel.o objects/gui_graphics.o objects/language.o objects/main.o objects/map.o objects/math_func.o objects/palette.o objects/path.o objects/path_build.o objects/path_gui.o objects/people.o objects/person.o objects/person_gui.o objects/random.o objects/ride_gui.o objects/ride_type.o objects/select_mode.o objects/shop_gui.o objects/sprite_store.o objects/string_func.o objects/terraform.o objects/terraform_gui.o objects/tile_func.o objects/toolbar_gui.o objects/video.o objects/viewport.o objects/widget.o objects/window.o -lSDL -lSDL_ttf
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lSDL_ttf
I presume the -l command links a library (what type of file? .o .a .lib ?) called 'SDL_ttf' and that this needs to be located somewhere, I build the SDL_ttf seperately in CodeBlocks and get a SDL_ttf.o file, but it isn't sufficient from getting it to progress on from this error.
I truely have no idea what Im doing, and its all guess work to this point. I've had top copy .h .a and .lib files for SDL to different folders (I have no idea what folders it eventually was happy with) to get the makefile process to progress with building the files to get to this point.
If someone could have a look at the source and give me some insight as to how to get this building correctly under Windows, what Im doing right and what Im doing wrong, and why I'm stuck, It would be really REALLY REALLY appreciated.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!