caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Alexey Egorov" <electreg@list.ru>
To: "Aziem Chawdhary" <aziem@chawdhary.co.uk>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Linking with zlib on ubuntu
Date: Tue, 02 May 2017 22:59:40 +0300	[thread overview]
Message-ID: <1493755180.672071950@f413.i.mail.ru> (raw)
In-Reply-To: <87ziev3vop.fsf@aziem-ThinkPad-X230>

Thanks, it solves the problem!

Unfortunately, ocamlbuild adds lflags at the beggining of ocamlopt invocation, so a little hacking required to make it work.


>Среда,  3 мая 2017, 0:28 +05:00 от Aziem Chawdhary <aziem@chawdhary.co.uk>:
>
>
>I think the linker flag is in the wrong place. So (from the
>github gist), instead of doing:
>
>ocamlopt -cclib -lz main.cmx test.o -o binary
>
>do the following:
>
>ocamlopt test.o -cclib -lz main.cmx -o binary
>
>This passes the linker flags to gcc in the correct order (i.e -lz before
>test.o). You can see the gcc commands invoked by adding the -verbose option
>to ocamlopt.
>
>
>Thanks,
>Aziem
>
>
>Alexey Egorov < electreg@list.ru > writes:
>
>> Hello,
>>
>> I'm trying to create mixed OCaml + C binary and got strange linker errors:  https://gist.github.com/anonymous/cc2b69c9e86ff2213e03f59a1ac5494b
>> I have zlib1g-dev installed and linking pure C executable with gcc is working.
>> Also I have no problem compiling this example on Centos 7.
>>
>> Any suggestions?
>> Thanks.
>
>
>-- 


--

  reply	other threads:[~2017-05-02 19:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-02 18:19 Alexey Egorov
2017-05-02 19:28 ` Aziem Chawdhary
2017-05-02 19:59   ` Alexey Egorov [this message]
2017-05-02 20:40     ` Aziem Chawdhary

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1493755180.672071950@f413.i.mail.ru \
    --to=electreg@list.ru \
    --cc=aziem@chawdhary.co.uk \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).