| delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f |
| From: | "deckerben" <deckerben AT freenet DOT de> |
| Newsgroups: | comp.os.msdos.djgpp |
| References: | <3ca78d87$0$364$9b622d9e AT news DOT freenet DOT de> <a8eoih$m9u$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <3cab2f26$0$152$9b622d9e AT news DOT freenet DOT de> <Pine DOT GSO DOT 4 DOT 44 DOT 0204040850130 DOT 10680-100000 AT mozart DOT orchestra DOT cse DOT unsw DOT EDU DOT AU> <3cace922$0$12701$9b622d9e AT news DOT freenet DOT de> <3CAD6C24 DOT 495D4F57 AT phekda DOT freeserve DOT co DOT uk> |
| Subject: | Re: making dxe2gen with clio.rice.edu binaries -or- "undefined reference to 'operator'"? |
| Date: | Tue, 9 Apr 2002 14:20:32 +0200 |
| X-Priority: | 3 |
| X-MSMail-Priority: | Normal |
| X-Newsreader: | Microsoft Outlook Express 6.00.2600.0000 |
| X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2600.0000 |
| Lines: | 52 |
| Message-ID: | <3cb2d8a3$0$28200$9b622d9e@news.freenet.de> |
| NNTP-Posting-Host: | 213.6.63.58 |
| X-Trace: | 1018353828 news.freenet.de 28200 213.6.63.58 |
| X-Complaints-To: | abuse AT freenet DOT de |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
> Note that if you compile and link a C++ program in one line, then gcc
knows it
> should link in the standard C++ library, because it knows its C++ from the
> file extension:
>
> gcc -g -Wall -o foo foo.cpp
But I tried that before I submitted the question and it wasn't working.
Say I compile manually (not hard with little dxe2gen..)
D:\Project\dxe2\src>gcc -O2 -c -g -Wall *.c -I../include
D:\Project\dxe2\src>gcc -O2 -g -Wall dxe2api.o dxe2stat.o -I../include
dxe2gen.cpp -o dxe2gen.exe
d:/user/djgpp/tmp\ccpkhKFC.o: In function `write_dxe(FILE*, FILE*,
external_file
hdr&)':
dxe2gen.cpp:237: undefined reference to `operator new[](unsigned long)'
dxe2gen.cpp:242: undefined reference to `operator new[](unsigned long)'
dxe2gen.cpp:249: undefined reference to `operator new[](unsigned long)'
dxe2gen.cpp:254: undefined reference to `operator new[](unsigned long)'
dxe2gen.cpp:481: undefined reference to `operator delete[](void*)'
dxe2gen.cpp:485: undefined reference to `operator delete[](void*)'
dxe2gen.cpp:486: undefined reference to `operator delete[](void*)'
dxe2gen.cpp:487: undefined reference to `operator delete[](void*)'
d:/user/djgpp/tmp\ccpkhKFC.o: In function `make_implib()':
dxe2gen.cpp:521: undefined reference to `operator new[](unsigned long)'
dxe2gen.cpp:616: undefined reference to `operator delete[](void*)'
dxe2gen.cpp:539: undefined reference to `operator delete[](void*)'
d:/user/djgpp/tmp\ccpkhKFC.o: In function `show_symbols(char const*)':
dxe2gen.cpp:647: undefined reference to `operator new[](unsigned long)'
d:/user/djgpp/tmp\ccpkhKFC.o(.eh_frame+0x11):dxe2gen.cpp: undefined
reference to
`__gxx_personality_v0'
collect2: ld returned 1 exit status
Note: it appears that gcc DID NOT 'link with the standard C++ library',
although the cpp file extension appeared in the second command line.
now I try it again with manual link option with library:
gcc -O2 -g -Wall dxe2api.o dxe2stat.o -I../include dxe2gen.cpp -o
dxe2gen.exe -lstdcxx
...and it works fine. it seems that GCC is not automaticly pulling up the
standard C++ lib here, even when a .cpp file is being specified.
???
Ben
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |