Re: Linking a program with a library??
Magnus Therning <[email protected]> Fri, 23 Jul 2004 10:17:45 +0200
| Newsgroups | gmane.comp.tools.aap.user |
|---|---|
| Message-ID | <[email protected]> |
And then I go and answer it myself. At least I've found one way, but I
don't think it's a very elegant one:
:program bar { add_LIBS = -L. -lfoo } : main.c
will solve it.
It would be nicer if it were possible to refer to 'foo' directly instead
of by using compiler flags. It would also be nice if this were possible
between :child aap-scripts. Something like this:
main.aap:
:child foo/main.aap
:child bar/main.aap
foo/main.aap:
:dll foo : foo.c
bar/main.aap:
:program bar { LINK = foo } : main.c
Any thoughts?
/M
On Fri, Jul 23, 2004 at 10:02:51AM +0200, Magnus Therning wrote:
>Hmm, amazingly bad subject I chose for this post. Linking program with
>library is what I meant of course.
>
>/M
>
>On Fri, Jul 23, 2004 at 09:45:43AM +0200, Magnus Therning wrote:
>>I am feeling really stupid here, but I simply can't get it to work!
>>
>>Files:
>>
>> foo.c
>> foo.h
>> main.c
>>
>>main.aap:
>>
>> :dll foo : foo.c
>>
>> :program bar { add_LIBS = -lfoo } : main.c
>>
>>Result:
>>
>>Aap: cc -MM foo.c > build-Linux2_6_7_1_k7/foo.c.aap
>>Aap: cc -O2 -fPIC -c -o build-Linux2_6_7_1_k7/foo.sho foo.c
>>Aap: ld -shared -o libfoo.so build-Linux2_6_7_1_k7/foo.sho
>>Aap: cc -MM main.c > build-Linux2_6_7_1_k7/main.c.aap
>>Aap: cc -O2 -c -o build-Linux2_6_7_1_k7/main.o main.c
>>Aap: cc -O2 -o bar build-Linux2_6_7_1_k7/main.o -lfoo
>>/usr/bin/ld: cannot find -lfoo
>>collect2: ld returned 1 exit status
>>Aap: Error in recipe "/home/magnus/prog/tst/aap_03/main.aap" line 3: Error executing commands for build default: Error in recipe "/usr/lib/aap/default.aap" line 414: Shell command returned 1
>>
>>I'd really like to get a '-L.' onto that last command, but how?
>>
>>/M
>>
>>--
>>Magnus Therning (OpenPGP: 0xAB4DFBA4)
>>[email protected]
>>http://magnus.therning.org/
>>
>>Maturity is when you quit blaming other people for your problems
>> -- Craig Burton
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by BEA Weblogic Workshop
>>FREE Java Enterprise J2EE developer tools!
>>Get your free copy of BEA WebLogic Workshop 8.1 today.
>>http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
>>_______________________________________________
>>A-A-P-user mailing list
>>[email protected]
>>https://lists.sourceforge.net/lists/listinfo/a-a-p-user
>
>--
>Magnus Therning (OpenPGP: 0xAB4DFBA4)
>[email protected]
>http://magnus.therning.org/
>
>The real problem we face with the web is not understanding the anomalies,
>it's facing how deeply weird the ordinary is.
> -- David Weinberger
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by BEA Weblogic Workshop
>FREE Java Enterprise J2EE developer tools!
>Get your free copy of BEA WebLogic Workshop 8.1 today.
>http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
>_______________________________________________
>A-A-P-user mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/a-a-p-user
--
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[email protected]
http://magnus.therning.org/
If you can tell the truth, you don't have to remember anything.
-- Mark Twain
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click