Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Makefiles and me - A story of sorrow

Options
  • 05-02-2007 12:50pm
    #1
    Closed Accounts Posts: 408 ✭✭


    Hi,

    I've been struggling with compiling files with C++ for some time now. I'm using the latest Dev-c++ compiler and SDL files to create a standard 2D game.

    I'm using the following tutorials to get to grips with SDL:
    http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/index

    My problem is that even when i compile a lesson for example lesson 5 i get the error message:

    32 P:\Project\Makefile.win
    [Build Error] [Warning] overriding commands for target `"../lesson5/lesson'


    I create a new project and then add lesson5.cpp, font.cpp and font.h to the project and then compile.

    Then i receive the above error message. Is there something fundamental i'm missing here ? i've inserted all the relevant files into the C:\Dev-cpp\ folders and changed the linker options to include "-lmingw32 -lSDLmain -lSDL" (without quotes).

    Could anyone help me out ?

    Cheers,

    daN


Comments

  • Registered Users Posts: 37,485 ✭✭✭✭Khannie


    have a look in the actual Makefile.win file. You probably have some duplication in there.

    Makefiles are horrible things.


  • Closed Accounts Posts: 461 ✭✭markf909


    Chada,

    I had a quick look at the example you are trying to use.
    There are only 2 cpp files so a Makefile may be OTT especially if you are only interested in understanding the code.

    Anyhoo I got this working no probs with gcc 3.4.3 on FC3 with the following line:

    g++ font.cpp lesson5.cpp -o lesson5 -lSDLmain -lSDL


  • Closed Accounts Posts: 408 ✭✭Chada


    Hey guys,

    thanks for input so far, my major concern with DEV-C++ is a piece of code im working on for my project, i've been trying to add pieces of code to it but i receive the same error message even when i re-load the exisiting code from scratch.

    I had a look at the compiler log and wondered did anyone know how to solve this:

    Compiler: Default compiler
    Building Makefile: "C:\Zelda Project\Makefile.win"
    Executing make...
    make.exe -f "C:\Zelda Project\Makefile.win" all
    g++.exe src/display.o src/engine.o src/main.o src/orc.o src/player.o src/sound.o src/sprite.o src/spriteBase.o src/MenuItem.o src/Menu.o src/Font.o src/SFont.o src/Item.o src/message.o -o "game.exe" -L"C:/Dev-Cpp/lib" -lmingw32 -lSDLmain -lSDL -lSDL_mixer -lSDL_image -lSDL_ttf -mwindows -s

    The system cannot find the path specified.

    make.exe: *** [game.exe] Error 1


    As far as i know the sdl.dll, sdl_mixer.dll, sdl_image.dll and sdl_tff all exist in the same directory as the project and i have put them into C:\dev-cpp\lib just to be sure, but still the same message.

    Can anyone help ?

    cheers,

    Dan


  • Closed Accounts Posts: 408 ✭✭Chada


    *shameless bump*

    Any ideas on my last post guys really stuck here


  • Registered Users Posts: 39 Talon.ie


    ok, it's complaining about a path it can't find. Looking through the commands it's executing I can see a couple of paths.

    1. src
    2. c:/Dev-Cpp/lib
    3. This one's implied, the directory where mingw32.dll is

    First and obvious question, do those paths exist?
    Does the working directory of g++.exe contain the src directory, i,e is g++ being run from the parent of src?
    I'd put money on this being the problem. (not a lot though, 10cent or something :-) )

    Double and triple check the spelling of your source filenames.
    I'm not sure about this but you might need -L<path to dir containing mingw32.dll>

    Just in case the error message is misleading, Is g++.exe in the PATH? i.e. if you just run g++ does it run properly?

    And I'm probably reaching here, but is there a chance that the hyphen in the directory name is causing the problem? I know it's quoted, but try renaming it to c:/DevCpp

    Good luck.


  • Advertisement
Advertisement