Thread: Makefile question

  1. #16
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    I mean do they match. Are you saying:

    header.h
    Code:
    #ifndef MYHEADER
    #define MYHEADER
    
    int function(void);
    
    #endif /* include once */
    definition.c
    Code:
    /* Copyright (c) 2008. -EquinoX-
     * All rights reserved. Please don't steal my code!
     * Its all I really have :(
     */
    
    int function(int x, int y)
    {
      return x * y;
    }

  2. #17
    Registered User
    Join Date
    Jan 2008
    Posts
    569
    Quote Originally Posted by master5001 View Post
    I mean do they match. Are you saying:

    header.h
    Code:
    #ifndef MYHEADER
    #define MYHEADER
    
    int function(void);
    
    #endif /* include once */
    definition.c
    Code:
    /* Copyright (c) 2008. -EquinoX-
     * All rights reserved. Please don't steal my code!
     * Its all I really have :(
     */
    
    int function(int x, int y)
    {
      return x * y;
    }
    yes, something like that.. I have all the ifndef in every .h file

  3. #18
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Something like that as in you defined your function one way, and prototyped it another, or something like that as in you just saw the pre-compiler directives and nodded and smiled?

  4. #19
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Multiple definitions make it sound like you've got code in your header files.
    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.

  5. #20
    Registered User
    Join Date
    Jan 2008
    Posts
    569
    I don't have any codes in my .h file all there is is just some definitions of structs and function header, please guys.. I really need to resolve this
    Last edited by -EquinoX-; 10-16-2008 at 04:41 PM.

  6. #21
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    So I'm afraid you're now going to have to convince us this is a makefile problem: can you compile this project manually without errors; and if so, what commands do you use to do so?

  7. #22
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Did you use extern when declaring variables in your header files?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Quick Compilation Question
    By chacham15 in forum C Programming
    Replies: 10
    Last Post: 10-12-2008, 08:15 PM
  2. A question about an interesting Makefile
    By meili100 in forum Tech Board
    Replies: 2
    Last Post: 08-12-2008, 03:56 PM
  3. about Makefile and Macro
    By tom_mk in forum C++ Programming
    Replies: 1
    Last Post: 09-18-2003, 01:07 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Makefile Newbie: Inheritance Question
    By Ashes999 in forum C++ Programming
    Replies: 2
    Last Post: 07-10-2003, 02:34 AM