| delorie.com/archives/browse.cgi | search |
| From: | "Βλάσης Χατζησταύρου" <vhatz AT ccf DOT auth DOT gr> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | LINK Problem |
| Date: | Wed, 6 Jan 1999 01:25:37 +0200 |
| Organization: | Central Computing Facility, Aristotle University of Thessaloniki |
| Lines: | 35 |
| Message-ID: | <76uaf8$ats$1@evia.ccf.auth.gr> |
| NNTP-Posting-Host: | dia-ppp11.ccf.auth.gr |
| X-Newsreader: | Microsoft Outlook Express 4.71.1712.3 |
| X-MimeOLE: | Produced By Microsoft MimeOLE V4.71.1712.3 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Hello,
I have a problem with linking. When I compile with:
g++ -o employee.exe employee.cpp person.cpp supervsr.cpp
everything compiles and runs perfectly.
If I compile separately:
g++ -c employee.cpp
g++ -c person.cpp
g++ -c supervsr.cpp
I get the .o files but then when I type:
ld -o employee.exe \djgpp\lib\crt0.o employee.o person.o supervsr.o -lc
I get:
c:/djgpp/bin/ld.exe: cannot open -lc: File format not recognized
The -lc option is supposed to invoke the libc.a library which is in
\djgpp\lib\.
I don't know what I'm doing wrong.
Could anyone please give a helpful advise?
Thank you,
Vlasis.
PS: If I try: ld -o employee.exe \djgpp\lib\crt0.o employee.o person.o
supervsr.o \djgpp\lib\libc.a
I get many screens of messages like these:
supervsr.o(.text+0x369):supervsr.cpp: undefined reference to `cout'
supervsr.o(.text+0x36e):supervsr.cpp: undefined reference to
`ostream::operator<
<(char const *)'
Any hints?
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |