This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: ld & my Makefile
- From: Ian Lance Taylor <iant at google dot com>
- To: mohsen at pahlevanzadeh dot org
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 13 Oct 2009 08:05:57 -0700
- Subject: Re: ld & my Makefile
- References: <1255485134.3828.15.camel@debian>
Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> writes:
> I wrote a program in C, Not C++.It work good.But when i use "-x c++" in
> Makefile, i receive following errors:
You have to link with the g++ driver. Yes, this is confusing.
> CC = gcc
> CFLAGS = -g -Wall -pthread -DHAVE_NET_ETHERNET_H -DLIBNET_LIL_ENDIAN
> -DDSNIFF_LIBDIR=\"$(libdir)/\"
> CPP = -x c++ -llibstcd++
If you use this approach, -llibstdc++ must come at the end of the link
line.
Ian