hey guys,
total newbie question here, but on this program I am writing I am, all of the sudden, getting an error saying "redefinition of 'show_all_passengers' ", and I'm not sure why this is happening.
Any help is really appreciated,
thanks,
John
hey guys,
total newbie question here, but on this program I am writing I am, all of the sudden, getting an error saying "redefinition of 'show_all_passengers' ", and I'm not sure why this is happening.
Any help is really appreciated,
thanks,
John
You probably have an object (show_all_passengers) in a header somewhere that's getting included multiple times which to the compilers point of view is attempting to have several different objects with the same name created (this is bad). If this is the case, remove the objects declaration from the header (or at least make it "extern" within the header) and make sure an actual declaration exists only in a single source file.
... or something along those lines.
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
If indeed the compiler is reincluding a header more than once, you should look up "include guards":
Include guard - Wikipedia, the free encyclopedia
Some compilers support the following:Code:/* contents of myheader.h */ #ifndef MYHEADER_H #define MYHEADER_H /* code here */ #endif
which tells the compiler to only use that header once.Code:/* first line of your header file */ #pragma once