Re: linking C++ object files

Luc Hermitte <[email protected]> Fri, 26 Nov 2004 08:51:14 +0100
Newsgroups gmane.comp.tools.aap.user
Message-ID <20041126075114.GC484@jade>
Hello,

* On Thu, Nov 25, 2004 at 01:22:11PM +0100, Bram Moolenaar <[email protected]> wrote:
> > I have a program made of two .cpp files.
> > AAP correctly uses "g++ -c" on both of them, but it uses "gcc" to link
> > the object files produced/
> 
> Did you try leaving out the ":usetool gcc"? 

Unfortunatelly, I can't.
If I don't do this, aap detects VC++. As I'm writing this tool for
Cygwin, and as it uses some functions specific to Cygwin, I can't use
VC++.

> That seems to avoid the problem for me.  It's still a problem though,
> telling Aap to use gcc should still result in g++ used for linking.
> This patch appears to fix that:

That's much better. Thanks!

However, that's not perfect yet.

With a build from scratch, that's fine: g++ is correctly called during
the link phase.
However, if I only need to (re)link (because I forget a library in the
first place, or I decide to use another library), aap calls gcc and not
g++.

I guess we should keep in mind (/on the disk) the object files have been
produced with g++ and not gcc.

Anyway, as it is quite rare we only need to just link, this is not
critical.

____
BTW, I notice that the error message says I have a problem into
test_realpath.cpp and not tests/test_realpath.cpp. However, I do not
know if it is an issue that'd better be fixed with aap, or if it must
must done in a compiler-plugin, that should try to detect in which
directory the file is.


____
> > BTW, is there an AAP compiler-plugin for vim somewhere ?
> No, you can simply do:
> 	:set makeprg=aap

Actually, I was thinking to correctly detect some AAP error messages as
error messages.
For instance, I have defined compiler/aap.vim with:
    ....
    " %+A is used to accept "Do not know" in the error message
    set efm+=%+EAap:\ Do\ not\ know\ %m
    " GCC link errors (undefined reference to..)
    set efm+=%[%^)]%#):%f:%m
    ....
but I was wondering if a more complete solution already exist.


Thanks.

-- 
Luc Hermitte


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/