Error in redefinition

I am having a error that the function is redefined in my file

Page 1 of 1

2 Replies - 1020 Views - Last Post: 11 March 2009 - 08:46 PM Rate Topic: -----

#1 Vidya R   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 06-March 09

Error in redefinition

Posted 11 March 2009 - 03:20 AM

Hi,

I am having a redefinition error while I give "make". I am working in Linux Red Hat 4. The problem is I have really redefined my function in another file. But I cant avoid them. This is needed for me in my code(of course, with the same name). I have included only one of these two in my header file. The other file, where the function is redefined is in another folder. This folder is also included in my make. I think this is the reason for the error, even when I have that file in another location. I need some files in that folder too. So, I cant remove that folder in my make. I have googled about this topic. I find saying that this redefinition will work in VC++ 6. But I want to work in C now..can anyone help me? Thanks in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: Error in redefinition

#2 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: Error in redefinition

Posted 11 March 2009 - 04:32 AM

Do you have include guards in your header file?

For example:
#ifndef MY_HEADER_FILE_H
#define MY_HEADER_FILE_H

// Definitions go here

#endif

Was This Post Helpful? 1
  • +
  • -

#3 Vidya R   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 06-March 09

Re: Error in redefinition

Posted 11 March 2009 - 08:46 PM

Thanks..that worked fine..NO ERRORS of redefinition now. Thanks for your reply.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1