Stuck Building a project & MakeFile under Windows
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Stuck Building a project & MakeFile under Windows

  1. #1
    Join Date
    Jan 2013
    Posts
    2

    Stuck Building a project & MakeFile under Windows

    Hi,

    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.

  2. #2
    Join Date
    Jul 2002
    Posts
    2,494

    Re: Stuck Building a project & MakeFile under Windows

    In Linux the message "cannot find -lSDL_ttf" means that it cannot find file libSDL_ttf.so (.so is like lib/dll in Windows). I am not sure about CygWin names, but you need to look for a library, and not object file.
    Last edited by Alex F; January 31st, 2013 at 12:44 AM.

  3. #3
    Join Date
    Jan 2013
    Posts
    2

    Re: Stuck Building a project & MakeFile under Windows

    Quote Originally Posted by Alex F View Post
    In Linux the message "cannot find -lSDL_ttf" means that it cannot find file libSDL_ttf.so (.so is like lib/dll in Windows). I am not sure about CygWin names, but you need to look for a library, and not object file.
    Thanks for the reply Alex.

    I can not find the file libSDL_ttf.so in the dev package for SDL_ttf. How do I create a .so file, do I have to create this myself with G++ with specific command line parameters, Code Blocks creates a SDL_ttf.o file when I build through its GUI.

    Thanks

  4. #4
    Join Date
    Jul 2002
    Posts
    2,494

    Re: Stuck Building a project & MakeFile under Windows

    g++ command line contains -lSDL switch. It looks like SDL library exists on your computer, and found by the linker. Try to investigate, how -lSDL switch is resolved - the same should be valid for -lSDL_ttf.
    Another guess: try also to add SDL_ttf.o that you already have, to the list of g++ object files, and remove -lSDL_ttf switch: maybe this will work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center