|
From: | stugol |
Subject: | Re: [Chicken-users] Having trouble statically compiling code |
Date: | Thu, 1 Sep 2016 02:03:26 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
Hi Peter, We're close, but not quite there yet:
I tried artificially adding 'setup-api'
as a dependency to 'intarweb', but it's not a real package and
so can't be linked. Again, I'm including a copy of the project as it currently stands. Cheers,
On 26/08/2016 20:41, Peter Bex wrote:
On Mon, Aug 22, 2016 at 10:33:11PM +0100, stugol wrote:Hi Peter, I've fixed the needs issue, and ensured that -uses is specified correctly, and now I'm getting "multiple definition" errors: /tmp/temp728b.18061/defstruct/../defstruct.c:68: multiple definition of `C_defstruct_toplevel' defstruct.o:/tmp/temp728b.18061/defstruct/../defstruct.c:68: first defined here (etc) I assume this is somehow happening because multiple .scm files are being statically linked with the same .o file - like if two eggs have a dependency on a third, the third .o file will be linked twice. But it can't have it both ways!Hi again Stuart, I've findally gotten around to look into this again (sorry about that), and it looks like the problem is simply in the final linking step: you link all the .o files together. But instead of linking each .o file once, you link them for every occurrance in the dependency tree. Simply deduplicate "object-files" in "compile-file" and you'll be fine. Cheers, Peter |
project.zip
Description: Zip archive
[Prev in Thread] | Current Thread | [Next in Thread] |