gnu.gcc.help
[Top] [All Lists]

Re: A question on linking

Subject: Re: A question on linking
From: Ulrich Eckhardt
Date: Fri, 28 Jul 2006 11:10:53 +0200
Newsgroups: gnu.gcc.help
dnucit@xxxxxxxxx wrote:
> I have a C file that needs to be linked with a C++ library.
> If i link using gcc, i get some unresolved references error.
> If i link using g++,its getting linked perfectly.
> Is it ok to  link a C file with a C++ library using g++?

Yes, it is OK. If you are using some part C++, you can't use the C compiler
as linker anymore.

> What are its implications?

g++, other than gcc, knows about additional libraries the C++ code needs at
runtime (the ones you got linker errors for), that is the whole difference
between them. 

Uli

-- 
http://gcc.gnu.org/faq.html

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy