From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 10CF2BB81 for ; Wed, 8 Dec 2004 19:56:12 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iB8IuBuV024227 for ; Wed, 8 Dec 2004 19:56:11 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA20802 for ; Wed, 8 Dec 2004 19:56:11 +0100 (MET) Received: from smtp.mbg.ocn.ne.jp (mbg.ocn.ne.jp [210.190.142.181]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iB8IuAQO024222 for ; Wed, 8 Dec 2004 19:56:10 +0100 Received: from localhost (p23160-adsau08doujib4-acca.osaka.ocn.ne.jp [221.190.198.160]) by smtp.mbg.ocn.ne.jp (Postfix) with ESMTP id 33A923F52 for ; Thu, 9 Dec 2004 03:56:09 +0900 (JST) Date: Thu, 09 Dec 2004 03:55:56 +0900 (JST) Message-Id: <20041209.035556.88469789.yoriyuki@mbg.ocn.ne.jp> To: caml-list@inria.fr Subject: linking C++ objects? From: Yamagata Yoriyuki X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 41B74E4B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41B74E4A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; yamagata:01 yoriyuki:01 yoriyuki:01 ocaml:01 ocaml:01 usr:01 lib:01 cpp:01 ocamlopt:01 cmx:01 lookup':01 rebuilt:01 compilation:01 exited:01 yamagata:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: I think there was a discussion about linking C++ objects, but I could not find in the archive. I thought that one way is to use -cc option, but making the linker have correct options may not be easy. Anything else? P.S. I use OMake, but OMake does not support mixing C++ and OCaml. I looked to OCamlProgram function's source to modify it, but I do not find it. Is it implemented by OCaml? (not OMake script?) The whole transcription is the following. Sorry for the lengthy message. cd /home/yori/src/misc/shinji/shinji/ cd .. && omake *** omake: reading OMakefiles *** omake: finished reading OMakefiles (0.1 sec) - build shinji dartsStub.o + cc -O3 . -I/usr/local/godi/lib/ocaml/std-lib/ -I.. -I../libchasen -I../darts -c dartsStub.cpp cc: .: linker input file unused because linking not done - build shinji shinji.opt + ocamlopt tools.o dartsStub.o mrph.cmx -o shinji.opt mrph.o(.text+0xc): In function `camlMrph__fun_132': : undefined reference to `darts_lookup' mrph.o(.text+0x22): In function `camlMrph__fun_127': : undefined reference to `darts_data_of_mrph' mrph.o(.text+0x32): In function `camlMrph__fun_129': : undefined reference to `darts_open' dartsStub.o(.text+0x21): In function `__static_initialization_and_destruction_0(int, int)': : undefined reference to `std::ios_base::Init::Init[in-charge]()' dartsStub.o(.text+0x96): In function `darts_open(long, long, long)': : undefined reference to `operator new(unsigned)' dartsStub.o(.text+0xdb): In function `darts_open(long, long, long)': : undefined reference to `cha_mmap_file' dartsStub.o(.text+0xe6): In function `darts_open(long, long, long)': : undefined reference to `cha_mmap_map' dartsStub.o(.text+0x127): In function `darts_open(long, long, long)': : undefined reference to `cha_mmap_file' dartsStub.o(.text+0x135): In function `darts_open(long, long, long)': : undefined reference to `cha_mmap_file' dartsStub.o(.text+0x154): In function `darts_open(long, long, long)': : undefined reference to `operator delete[](void*)' dartsStub.o(.text+0x164): In function `darts_open(long, long, long)': : undefined reference to `operator delete[](void*)' dartsStub.o(.text+0x229): In function `darts_lookup(long, long, long, long)': : undefined reference to `cha_mmap_map' dartsStub.o(.text+0x36d): In function `darts_data_of_mrph(long)': : undefined reference to `cha_mmap_map' dartsStub.o(.text+0x3cc): In function `__tcf_0': : undefined reference to `std::ios_base::Init::~Init [in-charge]()' dartsStub.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status Error during linking *** omake: failed (23.1 sec, 0/25 scans, 2/23 rules, 2/70 digests) *** omake: targets were not rebuilt because of errors: shinji/shinji.opt Compilation exited abnormally with code 2 at Thu Dec 9 03:38:11 -- Yamagata Yoriyuki