This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ld & my Makefile


Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> writes:

> On Tue, 2009-10-13 at 08:05 -0700, Ian Lance Taylor wrote:
>> 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.
>
>
> How do i solve my problem?I must use C++ not C,So i mandatory use g++ or
> -x c++.

I recommend that you use "g++" rather than "gcc -x c++".

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]