From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 9EC4680125 for ; Tue, 2 May 2017 21:28:25 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=aziem@chawdhary.co.uk; spf=Neutral smtp.mailfrom=aziem@chawdhary.co.uk; spf=None smtp.helo=postmaster@mail-wm0-f44.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of aziem@chawdhary.co.uk) identity=pra; client-ip=74.125.82.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="aziem@chawdhary.co.uk"; x-sender="aziem@chawdhary.co.uk"; x-conformance=sidf_compatible Received-SPF: Neutral (mail2-smtp-roc.national.inria.fr: domain of aziem@chawdhary.co.uk does not assert whether or not 74.125.82.44 is permitted sender) identity=mailfrom; client-ip=74.125.82.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="aziem@chawdhary.co.uk"; x-sender="aziem@chawdhary.co.uk"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wm0-f44.google.com) identity=helo; client-ip=74.125.82.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="aziem@chawdhary.co.uk"; x-sender="postmaster@mail-wm0-f44.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3A/7/YGR3fKTVpJMJXsmDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?se0eIvad9pjvdHbS+e9qxAeQG96Kt7Qc06L/iOPJYSQ4+5GPsXQPItRndiQuro?= =?us-ascii?q?EopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZv?= =?us-ascii?q?JuTyB4Xek9m72/q89pDXbAhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+?= =?us-ascii?q?VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfM?= =?us-ascii?q?QA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7S60/Vza/4KdxUBLohi?= =?us-ascii?q?kIOT4n/m/KiMN+gqFVrx29qBFk347YfJuYOOZicq7HYd8XQ3dKUMZLVyxGB4Ox?= =?us-ascii?q?d5cCDusAPelGqon2ukUDrRukCgiiGezvyiVHhmX23KYn1OkuCwDH3A0+ENILq3?= =?us-ascii?q?nbsNX1O70cUO+ozKnH1y/DbvNM1Tjh74jEaA0hofKVUL92bMHfx04vFwbfgVWR?= =?us-ascii?q?r4zoJzyV1uURs2ib8upvTvijhHIgqwF0pDWk28QiipHRi48XxV3I7zh1zJg1KN?= =?us-ascii?q?GiS0N3f8SoHZRfui2CKod6XMcvT3t1tCok0LELtoO3cDIXxJklxBPSbeGMfZKS?= =?us-ascii?q?7RL5TumRJC91hHJ7d7K7gBa/6U2gxff9VsmwyVpLoC9FnsXVunAD2BHe5dKLSv?= =?us-ascii?q?R6/kem1jaP0x7c5vtYLkAzkKrXM58hwrgumZoPqUnOHCD7lF/rgKOIdkgo4Oul?= =?us-ascii?q?5/r9brjpqZKQL4p0hRv/MqQqlMy/G+M4Mg0WUmeB+OW81aPs/UjiTbpWjv05iK?= =?us-ascii?q?fYv43aJcsBvK64AxVZ3Zok6xqlEjem08wUnWMbI1JdZBKHk4/pNknSL//iCPe/?= =?us-ascii?q?h02gkDNqx/DdIr3sGY7NL3jGkLf5Z7lx8U9cyAwpzdBe/Z1YEL8BIOigEnP24f?= =?us-ascii?q?XcAw80IkSZzOH9D8s1go4aVGmTGKKWGKfTqkPO/P95cMeWY4pAkST8Jv1tzP7n?= =?us-ascii?q?knM5kEUMNf2gz5oabVizHv15L0WQe2uqidBHDGRc7Vl2d/DjlFDXCW0bXH21Ra?= =?us-ascii?q?9pvjw=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0B8AQAs3QhZhixSfUpcHAEBBAEBCgEBF?= =?us-ascii?q?wEBBAEBCgEBhAyBDI5zkFuXfSyFeAKET0MUAQEBAQEBAQEBAQESAQEBCAsLCCg?= =?us-ascii?q?vgjMggkMBAgIBQAEBNwEECwsOEyUPASQBBQEcBhOKBgMNCA6jZT+LHYMRgwkBA?= =?us-ascii?q?QWIDwEBAQEBAQQBAQEBARsDBQkBCIQ9hwmKSJ1ZhxuDMokwiX+Gc5JpM4EVNoE?= =?us-ascii?q?rTjIERIRiH4FwdQEEiQQBAQE?= X-IPAS-Result: =?us-ascii?q?A0B8AQAs3QhZhixSfUpcHAEBBAEBCgEBFwEBBAEBCgEBhAy?= =?us-ascii?q?BDI5zkFuXfSyFeAKET0MUAQEBAQEBAQEBAQESAQEBCAsLCCgvgjMggkMBAgIBQ?= =?us-ascii?q?AEBNwEECwsOEyUPASQBBQEcBhOKBgMNCA6jZT+LHYMRgwkBAQWIDwEBAQEBAQQ?= =?us-ascii?q?BAQEBARsDBQkBCIQ9hwmKSJ1ZhxuDMokwiX+Gc5JpM4EVNoErTjIERIRiH4Fwd?= =?us-ascii?q?QEEiQQBAQE?= X-IronPort-AV: E=Sophos;i="5.38,280,1491256800"; d="scan'208";a="271383135" Received: from mail-wm0-f44.google.com ([74.125.82.44]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 02 May 2017 21:28:25 +0200 Received: by mail-wm0-f44.google.com with SMTP id m123so32378420wma.0 for ; Tue, 02 May 2017 12:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chawdhary-co-uk.20150623.gappssmtp.com; s=20150623; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=RzJ00Ws1Tzy5G83sSJpREscNddfSkqdS8mKbJi2Ju28=; b=MMvJfEW+PIX4h6xb6vT8X3DOKNgFTnAvgjB0APCNgkT9nbHNe2H91FdKY4xciX3UrI Wh2NZ/y0Kv1cZqk+PMmPy+N4eY358e8Lu8/3HZ85M98emPV0/VlfofXpX/Ke7J+cSpd0 ocjsAmAH+UkW6s++sO+S6IjZgcpwQVllJrIReXtQ+ikHAk/1bW7dCtsRQelbBn6spY0k 6Nej42paX281uKES3mye2LNLGsCwEh58OSFUv4DJuMUF5oc52z4z7ELUcVAeBAE/U9Vf V2f3gYRjVkEdRCwhkScVIHx1tfyvibEpuTT1c8PR4gH66+jDJrrgweI/LkodkdYkFQ4X ++Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=RzJ00Ws1Tzy5G83sSJpREscNddfSkqdS8mKbJi2Ju28=; b=HyUONXmm5DAcGHjWySaBHNSFvpNkjy+B9DRShD3tTD4R3C4AbWtB5LWyouD57dptYe FOfei8AfcBiYjNIODeHH+7RwCpl9Or1BnFBlKyCYUAxELabQvlxXHFaqjLGz/nYseNNO DhvrbfgABPwAP6t3ARSrgJVdQ+NlxKHYQvtNB1RkS7grEyIEHX8CFPYH2YP+U/xTGn7t 5sy4iD7pIMgUogdk0jNPoMZT/U43wUfr00od1tMUK3Q1Tcg5KkqId0fjydvdTiy+YPhu NqvnuUG6z0UX/AqM9+eXEvXYQmmCWkS/x+/ahwweDzhJbj9G1NT5IisqwwCEUEXLGgkM 0lRg== X-Gm-Message-State: AN3rC/5nttqgfeFoDejYPbx8DaLObZzIYnl10zUixSoAq5vnnp4GTXp0 NbLJK5/jMr+UhaNvx3Y= X-Received: by 10.28.30.23 with SMTP id e23mr3617638wme.94.1493753304268; Tue, 02 May 2017 12:28:24 -0700 (PDT) Received: from localhost (dhcp29B2.kent.ac.uk. [129.12.41.178]) by smtp.gmail.com with ESMTPSA id g132sm1968241wmd.33.2017.05.02.12.28.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 May 2017 12:28:22 -0700 (PDT) References: <1493749167.777759387@f198.i.mail.ru> User-agent: mu4e 0.9.16; emacs 26.0.50 From: Aziem Chawdhary To: Alexey Egorov Cc: caml-list In-reply-to: <1493749167.777759387@f198.i.mail.ru> Date: Tue, 02 May 2017 20:28:22 +0100 Message-ID: <87ziev3vop.fsf@aziem-ThinkPad-X230> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Caml-list] Linking with zlib on ubuntu 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 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. --