1

I have an old C program (which I didn't write) which worked for me before on a machine I had using DJGPP with RHIDE under DOS.

The problem is, that since I've moved to a new machine, when I try and compile it, I get loads (100s) of "'variable' undeclared (first use in this function)" warnings.

I don't have the time to go back over this and amend the code at the minute... is there a way to disable this warning and let me build?

Thanks for any help.

EDIT:

Sorry guys, this isn't my area at all. The following code:

char *sbname;
sbname = calloc (99, sizeof(char));

The second line produces an error of:

Error: 'sbname' undeclared (first use in this function)

This hadn't produced any errors on the last machine, so I assumed there is a setup issue.

Thanks

Galwegian
  • 41,475
  • 16
  • 112
  • 158
  • 2
    *Warnings* shouldn't stop you building the code. Do you mean *errors* ? Can you give an example code fragment that results in an error, along with the actual error message ? – Paul R Jun 20 '11 at 15:41
  • 2
    Those are errors not warnings. You need to fix them to compile your program. Sometimes something trivial like missing `;` can cause lots or errors. Focus on first reported error. It's probably causing the rest. – Piotr Praszmo Jun 20 '11 at 16:35
  • are these lines consecutive? are they actually inside a function? can you put them in a separate source file, inside a function, and try to compile it? – n. m. could be an AI Jun 20 '11 at 18:42
  • @n.m. - yes, they're consecutive and inside a function. – Galwegian Jun 21 '11 at 10:24
  • 1
    Hmm, odd! Do you get any other errors, or is it just that? (Could you post a bit more code?). – marnir Jun 22 '11 at 22:24
  • 1
    (And I'm not sure it's relevant, but are there any .h files being included, for example?) – marnir Jun 22 '11 at 22:27
  • 1
    Could it be that you have CRLF issues here? DOS using CRLF, Mac using CR only and the compiler being picky? – Johan Bezem Nov 17 '11 at 16:34

0 Answers0