Re: linking libgit.a in C++ projects
- From
Pedro Melo <melo@simplicidade.org>
- Date
- Jul 31, 2008, 11:16 UTC
- Message-ID
- <0EC13CCC-0F7B-41A0-BEB2-67E6EC8D5E37@simplicidade.org>
- In-Reply-To
- <ac9f0f090807310410u461f5584ved74769d8452c539@mail.gmail.com>
On Jul 31, 2008, at 12:10 PM, cte wrote:
Show 11 quoted lines
> On Thu, Jul 31, 2008 at 3:57 AM, Dmitry Potapov <dpotapov@gmail.com> > wrote: >> On Thu, Jul 31, 2008 at 02:53:37AM -0700, cte wrote: >>> However, the git source uses a few reserved C++ keywords; namely >>> 'typename', and 'new'. >> >> Because this source code are meant to be compiled by C and not by C+ >> +! >> Even if we will have real git library for other applications to use, >> it still be compiled only by C. Thus, C++ keywords are not issue. >
[...]
Show 5 quoted lines
> Fortunately, g++ can compile C programs and link static libraries that > were compiled by C compilers, unless of course, they use C++ keywords. > I don't think it is unreasonable to rename the _very few_ C++ keywords > in git's source in the interest of allowing C++ projects to leverage > libgit.
I think the point Dmitry was trying to make is that you should compile libgit as C, using gcc, and then link it with your C++/Objective C code.
No patch is required to git, only to your makefile/xcode project file.
Best regards,
-- Pedro Melo Blog: http://www.simplicidade.org/notes/ XMPP ID: melo@simplicidade.org Use XMPP!