From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 1F3ADBBAF for ; Tue, 15 Dec 2009 14:50:36 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As0BACIjJ0vRVdi/kGdsb2JhbACUL4ZRPwEBAQEJCQwHEwOtSTGFLCGIQgECAwWEJgSLIw X-IronPort-AV: E=Sophos;i="4.47,400,1257116400"; d="scan'208";a="52144949" Received: from mail-px0-f191.google.com ([209.85.216.191]) by mail4-smtp-sop.national.inria.fr with ESMTP; 15 Dec 2009 14:50:35 +0100 Received: by pxi29 with SMTP id 29so2918085pxi.1 for ; Tue, 15 Dec 2009 05:50:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=dKiYCcYDUyE2qyYSlqFwrr1HwYx83sOkCiD5D4EZHJI=; b=i2OXPRW4OSXu8QTCjT4vJyDh1c09ok+9oBIgiqSriIQL8j4MVZKujey+Iz8cMkEG/l SBFIJheUcLnKF5ZUCUQTIm15dBXV1ryAiJ6M1dNnmO9uka0B//75oHtOXcJFOrL48z18 ZsTYvz2XOE/y0E/3U/XNpZR4ddjXkG+W9i31k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=AEYvw4DXjOOA8mfxNX7XIum+YjM5CieK5EM16y640dOks0Q/qXtUi4LV2Nnh2d/AhX aqv0jj8vEazXrnLMPo91pqQ45QuhaoZvkixAaoauIVUIbTBhLjhchA3zYOkNKtqx/8kS 3NVqpBPHHfLdvTtlqQ3N1GQFR7HYKUyin+xow= MIME-Version: 1.0 Sender: aaron678@gmail.com Received: by 10.142.59.5 with SMTP id h5mr4195682wfa.107.1260885033696; Tue, 15 Dec 2009 05:50:33 -0800 (PST) In-Reply-To: References: Date: Tue, 15 Dec 2009 08:50:33 -0500 X-Google-Sender-Auth: 3e0e50402b1bbb6a Message-ID: Subject: Re: [Caml-list] linking errors involving cpp files From: Aaron Bohannon To: Robert Roessler Cc: OCaml List Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; cpp:01 ocaml:01 ocaml:01 cpp:01 2009:98 wrote:01 wrote:01 upenn:01 naming:01 caml-list:01 caml:02 linking:02 dec:05 tue:06 extension:06 On Tue, Dec 15, 2009 at 1:59 AM, Robert Roessler wrote: > Aaron Bohannon wrote: >> >> How do I link C++ code with OCaml? > You might try (when mixing C++ and OCaml) wrapping the whole thing in an > 'extern "C" {...}' block (*including* the #includes and the entire main > function). Thanks for the tip. This does resolve the missing caml symbols (even when naming the file with a cpp extension). However, my real program actually uses some C++ features. I think I could convert it to a real C program, but I assumed there would be some other way. - Aaron