Thread: help with makefile

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    104

    help with makefile

    I got it working , can someone please delete my attached files to avoid plagiarism
    Last edited by ICool; 10-22-2007 at 12:07 AM.

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Quote Originally Posted by ICool View Post
    When I go to terminal and type Makefile.bak
    Huh? I'm familiar with typing make, which defaults to finding makefile.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    104
    ................. working
    Last edited by ICool; 10-22-2007 at 12:26 AM.

  4. #4
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    it says permission denied
    Vista like to spring this kinda stuff on me all the time :'(

  5. #5
    Registered User
    Join Date
    Sep 2007
    Posts
    104
    If these are just warnings maybe I can still run it ?

  6. #6
    Registered User
    Join Date
    Sep 2007
    Posts
    104
    Please help , I have no idea how to get it working .....

  7. #7
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Code:
    int (*Image_invert(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y]))[]
    This looks odd to me, and apparently your compiler too. I don't have your header.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  8. #8
    Registered User
    Join Date
    Sep 2007
    Posts
    104
    Header ? Do you mind checking the Image.c file , I' m not able to post the contents now , the network is clogged up at uni , and I can't even get terminal to open .
    Last edited by ICool; 10-21-2007 at 09:29 PM.

  9. #9
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Code:
    #include "ep100lib.h"
    Without it, my compiler complains differently.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  10. #10
    Registered User
    Join Date
    Sep 2007
    Posts
    104
    The header is present in both Image.c and the Image_lib.c ??

  11. #11
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    To you.

    If you are asking folks here to make stuff up and guess how to help, it makes for a long and difficult journey.

    Then again, I'm off my game again lately.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  12. #12
    Registered User
    Join Date
    Sep 2007
    Posts
    104
    Uhm I just don't know how to solve my errors . I gave you all the information I can .

  13. #13
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Image.c contains this line
    #include "Image_lib.c"

    It should be written as
    #include "Image_lib.h"


    Where Image_lib.h is a new file containing
    Code:
    #ifndef IMAGE_LIB_INCLUDED
    #define IMAGE_LIB_INCLUDED
    
    #define EP100_LIB_MAX_X 1024
    #define EP100_LIB_MAX_Y 1024
    
    int (*Image_invert(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y]))[];
    
    // A procedure that will scroll an image horizontally and return back into matrix
    void Image_horizontal_scroll(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y], int scroll, int height, int width);
    
    // A procedure that will scroll an image vertically and return back into matrix
    void Image_vertical_scroll(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y], int scroll, int height, int width);
    
    #endif
    Image_lib.c should also include this file as well.

    After that, your scroll functions need looking at because I don't think they're returning the modified result.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  14. #14
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Salem View Post
    Image.c contains this line
    #include "Image_lib.c"

    It should be written as
    #include "Image_lib.h"


    Where Image_lib.h is a new file containing
    Code:
    #ifndef IMAGE_LIB_INCLUDED
    #define IMAGE_LIB_INCLUDED
    
    #define EP100_LIB_MAX_X 1024
    #define EP100_LIB_MAX_Y 1024
    
    int (*Image_invert(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y]))[];
    
    // A procedure that will scroll an image horizontally and return back into matrix
    void Image_horizontal_scroll(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y], int scroll, int height, int width);
    
    // A procedure that will scroll an image vertically and return back into matrix
    void Image_vertical_scroll(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y], int scroll, int height, int width);
    
    #endif
    Image_lib.c should also include this file as well.

    After that, your scroll functions need looking at because I don't think they're returning the modified result.
    The EP100... constants should really come from teh EP100 lib file, if I've understood the other thread.

    But the halucinogenic drugs influencing the teacher is springing up again: Apparently, the students have been told to create TWO source files, one main and one which contains the image_invert. So an extra header file is (from what I understand) not allowed... Stupid rules - I can understand rules that say "You can't use this library function, because you should be implementing it yourself". But I don't see the point of teaching really bad habits.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  15. #15
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    >I got it working , can someone please delete my attached files to avoid plagiarism
    Don't do that, what if someone else has the same or similar problem?

    If you want to avoid plagiarism, don't post your code in the first place.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Makefile Problem: None rule to make target
    By chris24300 in forum Linux Programming
    Replies: 25
    Last Post: 06-17-2009, 09:45 AM
  2. Building a project using a Makefile
    By starcatcher in forum Windows Programming
    Replies: 2
    Last Post: 11-23-2008, 11:50 PM
  3. unix makefile won't work but works in Dev C++
    By jk1998 in forum C++ Programming
    Replies: 1
    Last Post: 06-09-2007, 03:54 PM
  4. makefile blues....
    By WaterNut in forum C Programming
    Replies: 6
    Last Post: 05-30-2005, 08:22 PM
  5. Need help with Makefile
    By xshapirox in forum C++ Programming
    Replies: 14
    Last Post: 09-28-2004, 03:32 PM