From: "DeHackEd" References: <199712211736 DOT JAA29431 AT adit DOT ap DOT net> Subject: Re: Erreur with linker Date: Mon, 22 Dec 1997 09:17:07 -0500 Lines: 30 Message-ID: <#wvgHPuD9GA.347@upnetnews02.moswest.msn.net> Newsgroups: comp.os.msdos.djgpp To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Nate Eldredge wrote in message <199712211736 DOT JAA29431 AT adit DOT ap DOT net>... >At 11:19 12/20/1997 -0500, jpsabour AT videotron DOT ca wrote: >>Why DJGPP give there errors whe I compile this simple class. I use a >>makefile but the problem it same when I compile whitout makefile >Is the error in compiling or in linking? >If in linking, make sure you use the `gxx' command to link so that the C++ >libraries get scanned. >When I compile your code, I get `implicit declaration of function' for >`somme' and `soust'. My knowledge of C++ is very small, but since they are >member functions, don't you have to define an instance of class `test' and >call them with respect to it? > >Nate Eldredge >eldredge AT ap DOT net > > > If you are compiling in C++, you almost HAVE to prototype your functions. C++ mangles the name so the linker can link by function name, not be paramaters (which it won't reconize anyway). If it has no prototypes, it does not mangle. If you get undefined references to names that are the literal names, make sure you have a .h file defining them properly. Use the same .h file for the real functions and the program and C++ will warn you of any mismatching functions. If you are using C, forget what I just typed. :)