X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: Help: Problem to link C++ program with ld Date: 23 May 2006 18:31:07 GMT Lines: 25 Message-ID: <4dh2nbF14pugpU3@news.dfncis.de> References: <20060523070118 DOT 450B69176A AT mail DOT m-online DOT net> X-Trace: news.dfncis.de Csqg9RzOY1qj53nKcLF6dAXJuHLMv27iCp9Yxzg3+LE5+U9K6cPzlLUZmn X-Orig-Path: not-for-mail To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Dr. Xiangdong Wang wrote: > I can compile and link it with gxx > gxx main.cpp > but if I link it with ld, > ld -lc -lstdcx -lsupcxx -lgcc main.o -o main.bin But why would you want to do that? Or, if you really have to, why don't you ask the one tool in your hands that obviously already knows how to do it, to help you out? That tool is GCC itself. gxx -v main.cpp should be enlightening. Lesson learned: if you don't know exactly how ld has to be run to a link a program for a given platform, don't even try. Let GCC handle it. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.