From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA26191; Fri, 18 Jul 2003 08:43:47 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA22994 for ; Fri, 18 Jul 2003 08:43:45 +0200 (MET DST) Received: from mail.libertysurf.net (mail.libertysurf.net [213.36.80.91]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h6I6hjT20643 for ; Fri, 18 Jul 2003 08:43:45 +0200 (MET DST) Received: from tiscali.fr (192.168.10.29) by mail.libertysurf.net (6.5.026) id 3ECC3D0200C2089D for caml-list@inria.fr; Fri, 18 Jul 2003 08:43:45 +0200 Date: Fri, 18 Jul 2003 08:43:45 +0200 Message-Id: Subject: [Caml-list] =?iso-8859-1?Q?linking_problem_with_camlidl_on_windows?= MIME-Version: 1.0 X-Sensitivity: 3 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable From: "=?iso-8859-1?Q?matthieu.dubuget@libertysurf.fr?=" To: "=?iso-8859-1?Q?caml-list?=" X-XaM3-API-Version: 3.2 R30 (B58 pl3) X-type: 0 X-SenderIP: 81.50.108.135 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; matthieu:01 dubuget:01 somme:01 char:01 toto:01 hand-written:01 mli:01 ocamlidl:01 -header:01 ocamlc:01 alloc:01 libpath:01 nmake:01 tiscali:99 cher:99 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello!=0D=0A=0D=0AI posted a question some days ago, but it was not very = precise.=0D=0A=0D=0AI am trying to use one DLL from Ocaml with camlidl.=0D= =0A=0D=0ASince I can't have this work on windows (no problem under=0D=0Al= inux) because of linking problems, I reproduced it there.=0D=0A=0D=0ATher= e are 4 files :=0D=0Asomme.c, somme.def, somme.idl, somme_stubs.def=0D=0A= =0D=0A**** somme.c ****=0D=0A#include "somme.h"=0D=0A=0D=0Achar * toto[3]= =3D { "un", "deux", "trois" };=0D=0A=0D=0Ahandle get(int indice){=0D=0A = return toto[indice];=0D=0A}=0D=0A=0D=0Achar * string_of_handle(handle h)= {=0D=0A return (char *) h;=0D=0A}=0D=0A**** somme.c ****=0D=0A**** somme= .def *****=0D=0AEXPORTS=0D=0A get=0D=0A string_of_handle=0D=0A**** = somme.def *****=0D=0A=0D=0AHere is the somme.idl file :=0D=0A=0D=0A**** s= omme.idl ****=0D=0Atypedef [abstract] char * handle;=0D=0A=0D=0Ahandle g= et([in] int indice);=0D=0A=0D=0A[string] char * string_of_handle([in] han= dle h);=0D=0A**** somme.idl ****=0D=0A**** somme_stubs.def ****=0D=0AEXPO= RTS=0D=0A camlidl_somme_get=0D=0A camlidl_somme_string_of_handle=0D= =0A**** somme_stubs.def ****=0D=0A=0D=0AHere are the steps (*files are th= e 4 hand-written files):=0D=0A=0D=0A =0D=0A*som= me.def|-3->somme.dll|-5->somme_stubs.dll=0D=0A *somme.c|-2-= > somme.obj| |=0D=0A*somme.idl-1->|somme.h = |=0D=0A |somme_stubs.c-4-> somme_stubs.obj |=0D= =0A | *somme_stubs.def |=0D=0A = |somme.ml=0D=0A |somme.mli=0D=0A=0D=0A1/ ocamlidl -header= somme.idl=0D=0A2/ cl /c somme.c=0D=0A3/ link /dll /out:somme.dll /def:so= mme.def somme.obj=0D=0A4/ ocamlc -c somme_stubs.c=0D=0A=0D=0A5/ Here is = the step I cannot pass, because there are always=0D=0Aunresolved external= symbols. I cannot guess which library I=0D=0Ashould link? Is it possible= that I made something wrong when=0D=0Ainstalling camlidl?=0D=0A=0D=0AFIR= ST TRY:=0D=0Alink /dll /out:somme_stubs.dll /def:somme_stubs.def=0D=0Asom= me_stubs.obj somme.lib=0D=0AMicrosoft (R) Incremental Linker Version 6.00= .8168=0D=0ACopyright (C) Microsoft Corp 1992-1998. All rights reserved.=0D= =0A=0D=0A Creating library somme_stubs.lib and object somme_stubs.exp=0D= =0Asomme_stubs.obj : error LNK2001: unresolved external symbol=0D=0A_allo= c=0D=0Asomme_stubs.obj : error LNK2001: unresolved external symbol=0D=0A_= camlidl_free=0D=0Asomme_stubs.obj : error LNK2001: unresolved external sy= mbol=0D=0A_copy_string=0D=0Asomme_stubs.dll : fatal error LNK1120: 3 unre= solved externals=0D=0A=0D=0ASECOND TRY (worse):=0D=0Alink /dll /out:somme= _stubs.dll /def:somme_stubs.def=0D=0Asomme_stubs.obj somme.lib /libpath:"= c:/ocaml/lib" libcamlidl.lib=0D=0AMicrosoft (R) Incremental Linker Versio= n 6.00.8168=0D=0ACopyright (C) Microsoft Corp 1992-1998. All rights reser= ved.=0D=0A=0D=0A Creating library somme_stubs.lib and object somme_stub= s.exp=0D=0Asomme_stubs.obj : error LNK2001: unresolved external symbol=0D= =0A_alloc=0D=0Asomme_stubs.obj : error LNK2001: unresolved external symbo= l=0D=0A_copy_string=0D=0Alibcamlidl.lib(idlalloc.obj) : error LNK2001: un= resolved=0D=0Aexternal symbol _invalid_argument=0D=0Alibcamlidl.lib(idlal= loc.obj) : error LNK2001: unresolved=0D=0Aexternal symbol _alloc_small=0D= =0Alibcamlidl.lib(idlalloc.obj) : error LNK2001: unresolved=0D=0Aexternal= symbol _local_roots=0D=0Alibcamlidl.lib(idlalloc.obj) : error LNK2001: u= nresolved=0D=0Aexternal symbol _stat_alloc=0D=0Alibcamlidl.lib(idlalloc.o= bj) : error LNK2001: unresolved=0D=0Aexternal symbol _raise_out_of_memory= =0D=0Alibcamlidl.lib(idlalloc.obj) : error LNK2001: unresolved=0D=0Aexter= nal symbol __imp__CoTaskMemAlloc@4=0D=0Alibcamlidl.lib(idlalloc.obj) : er= ror LNK2001: unresolved=0D=0Aexternal symbol __imp__CoTaskMemFree@4=0D=0A= libcamlidl.lib(idlalloc.obj) : error LNK2001: unresolved=0D=0Aexternal sy= mbol _stat_free=0D=0Alibcamlidl.lib(idlalloc.obj) : error LNK2001: unreso= lved=0D=0Aexternal symbol _string_length=0D=0Asomme_stubs.dll : fatal err= or LNK1120: 11 unresolved externals=0D=0ANMAKE : fatal error U1077: 'link= ' : return code '0x460'=0D=0AStop.=0D=0A=0D=0ACOMMENTS:=0D=0AI did the sa= me thing on linux and it worked fine.=0D=0AI did it with a simpler idl fi= le on windows (without=0D=0Aabstract type definition) and it worked too.=0D= =0A=0D=0AWhere am I wrong ?=0D=0A=0D=0AThanks in advance=0D=0A=0D=0AMatth= ieu Dubuget=0D=0A=0A=0A********** L'ADSL A 20 EUR/MOIS**********=0ATiscal= i propose l'ADSL le moins cher du march=E9 : 20 EUR/mois et le modem ADSL= offert ! =0APour profiter de cette offre exceptionnelle, cliquez ici : h= ttp://register.tiscali.fr/adsl/=0AOffre soumise =E0 conditions.=0A ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners