caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Can't compile on Cygwin
@ 2004-09-27  6:54 overbored
  2004-09-27  7:55 ` skaller
  0 siblings, 1 reply; 5+ messages in thread
From: overbored @ 2004-09-27  6:54 UTC (permalink / raw)
  To: caml-list

I followed the instructions in the INSTALL* files (installed ocaml in 
Cygwin) but when I run 'make UISTYLE=text' I get:

...
ocamlopt -I lwt -I ubase -c /home/unison-2.9.1/main.ml
ocamlopt: linktext.ml ---> linktext.cmx
ocamlopt -I lwt -I ubase -c /home/unison-2.9.1/linktext.ml
Linking unison.exe
ocamlopt -verbose -I lwt -I ubase -o unison.exe   unix.cmxa str.cmxa 
-cclib win32rc/unison.res.lib ubase/safelist.cmx ubase/uprintf.cmx 
ubase/util.cmx ubase/rx.cmx ubase/uarg.cmx ubase/prefs.cmx 
ubase/trace.cmx lwt/pqueue.cmx lwt/lwt.cmx lwt/lwt_util.cmx 
lwt/lwt_unix.cmx case.cmx pred.cmx uutil.cmx fileutil.cmx name.cmx 
path.cmx fspath.cmx props.cmx fileinfo.cmx os.cmx lock.cmx uri.cmx 
common.cmx tree.cmx checksum.cmx transfer.cmx xferhint.cmx remote.cmx 
globals.cmx update.cmx files.cmx sortri.cmx recon.cmx transport.cmx 
strings.cmx uicommon.cmx uitext.cmx main.cmx linktext.cmx
+ as -o '/tmp/camlstartup2c9bb5.o' '/tmp/camlstartup814133.s'
+ gcc   -o 'unison.exe' -I'/home/yang/local/lib/ocaml' 
'/tmp/camlstartup2c9bb5.o' '/home/yang/local/lib/ocaml/std_exit.o' 
'linktext.o' 'main.o' 'uitext.o' 'uicommon.o' 'strings.o' 'transport.o' 
'recon.o' 'sortri.o' 'files.o' 'update.o' 'globals.o' 'remote.o' 
'xferhint.o' 'transfer.o' 'checksum.o' 'tree.o' 'common.o' 'uri.o' 
'lock.o' 'os.o' 'fileinfo.o' 'props.o' 'fspath.o' 'path.o' 'name.o' 
'fileutil.o' 'uutil.o' 'pred.o' 'case.o' 'lwt/lwt_unix.o' 
'lwt/lwt_util.o' 'lwt/lwt.o' 'lwt/pqueue.o' 'ubase/trace.o' 
'ubase/prefs.o' 'ubase/uarg.o' 'ubase/rx.o' 'ubase/util.o' 
'ubase/uprintf.o' 'ubase/safelist.o' '/home/yang/local/lib/ocaml/str.a' 
'/home/yang/local/lib/ocaml/unix.a' 
'/home/yang/local/lib/ocaml/stdlib.a'  '-Llwt' '-Lubase' 
'-L/home/yang/local/lib/ocaml' '-lstr' '-lunix' 'win32rc/unison.res.lib' 
'/home/yang/local/lib/ocaml/libasmrun.a' -lm
ubase/uprintf.o(.text+0x29a):fake: undefined reference to `_format_int'
ubase/uprintf.o(.text+0x2fa):fake: undefined reference to `_format_float'
collect2: ld returned 1 exit status
Error during linking
make: *** [unison.exe] Error 2

Google returned nothing when I looked for "undefined reference to 
_format_int". What's going on? Please help, thanks in advance.

-------------------
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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Can't compile on Cygwin
  2004-09-27  6:54 [Caml-list] Can't compile on Cygwin overbored
@ 2004-09-27  7:55 ` skaller
  2004-09-27  8:10   ` overbored
  0 siblings, 1 reply; 5+ messages in thread
From: skaller @ 2004-09-27  7:55 UTC (permalink / raw)
  To: overbored; +Cc: caml-list

On Mon, 2004-09-27 at 16:54, overbored wrote:

> ubase/uprintf.o(.text+0x29a):fake: undefined reference to `_format_int'
> ubase/uprintf.o(.text+0x2fa):fake: undefined reference to `_format_float'

Old version. I've had this problem on a Linux box too.
Used to be 'format_int' and 'format_float' were builtin primitives,
that is, C functions.

All C primitives in Ocaml 3.08 now have a prefix 'caml_'
to avoid namespace clashes:

stdlib/pervasives.ml:external format_int: string -> int -> string =
"caml_format_int"

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Can't compile on Cygwin
  2004-09-27  7:55 ` skaller
@ 2004-09-27  8:10   ` overbored
  2004-09-27  9:16     ` skaller
  2004-09-27  9:43     ` Damien Doligez
  0 siblings, 2 replies; 5+ messages in thread
From: overbored @ 2004-09-27  8:10 UTC (permalink / raw)
  To: skaller; +Cc: caml-list

What the...wow, sorry about that! That question actually pertained to 
unison, not Ocaml. But since this is getting somewhere... :)

I'm a newbie to Ocaml so I wasn't entirely sure what to do but the only 
file in unison that used format_int had the lines:

external format_int: string -> int -> string = "format_int"
external format_float: string -> float -> string = "format_float"
[format_int and format_float are used further down in the file]

So should I prepend "caml_" to both the stuff in quotes and the stuff on 
the left? I did that and it compiled fine but I'm wondering if modifying 
the stuff in quotes might cause problems later on.

Thanks!

skaller wrote:
> On Mon, 2004-09-27 at 16:54, overbored wrote:
> 
> 
>>ubase/uprintf.o(.text+0x29a):fake: undefined reference to `_format_int'
>>ubase/uprintf.o(.text+0x2fa):fake: undefined reference to `_format_float'
> 
> 
> Old version. I've had this problem on a Linux box too.
> Used to be 'format_int' and 'format_float' were builtin primitives,
> that is, C functions.
> 
> All C primitives in Ocaml 3.08 now have a prefix 'caml_'
> to avoid namespace clashes:
> 
> stdlib/pervasives.ml:external format_int: string -> int -> string =
> "caml_format_int"
> 

-------------------
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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Can't compile on Cygwin
  2004-09-27  8:10   ` overbored
@ 2004-09-27  9:16     ` skaller
  2004-09-27  9:43     ` Damien Doligez
  1 sibling, 0 replies; 5+ messages in thread
From: skaller @ 2004-09-27  9:16 UTC (permalink / raw)
  To: overbored; +Cc: caml-list

On Mon, 2004-09-27 at 18:10, overbored wrote:
> What the...wow, sorry about that!

LOL .. Why are you sorry? 

>  That question actually pertained to 
> unison, not Ocaml.

Sure -- Ocaml changed. Your version of Unison hasn't
been upgraded to match. This particular problem 
was expected -- the change in Ocaml breaks compatibility.

However, it also removes problems with name clashes
when linking/compiling with other C stuff.
So some pain is expected in the transition but
it considered worthwhile.

I actually ran into this problem myself a while back
and didn't know what was going on either.

> external format_int: string -> int -> string = "format_int"
> external format_float: string -> float -> string = "format_float"

> So should I prepend "caml_" to both the stuff in quotes and the stuff on 
> the left? 

Probably just the stuff in quotes .. that's the C name of
the function. The LHS is the Ocaml name. However if you changed
the :HS names and all references to them, it should be OK.


-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Can't compile on Cygwin
  2004-09-27  8:10   ` overbored
  2004-09-27  9:16     ` skaller
@ 2004-09-27  9:43     ` Damien Doligez
  1 sibling, 0 replies; 5+ messages in thread
From: Damien Doligez @ 2004-09-27  9:43 UTC (permalink / raw)
  To: overbored; +Cc: caml-list

On Sep 27, 2004, at 10:10, overbored wrote:

> external format_int: string -> int -> string = "format_int"
> external format_float: string -> float -> string = "format_float"
> [format_int and format_float are used further down in the file]
>
> So should I prepend "caml_" to both the stuff in quotes and the stuff 
> on the left? I did that and it compiled fine but I'm wondering if 
> modifying the stuff in quotes might cause problems later on.

You should prepend "caml_" to the stuff in quotes.  No need to do it
on the left.  The stuff in quotes is the C names of the primitives,
and that is what has changed between 3.07+2 and 3.08.0.

-- Damien

-------------------
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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-09-27  9:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-27  6:54 [Caml-list] Can't compile on Cygwin overbored
2004-09-27  7:55 ` skaller
2004-09-27  8:10   ` overbored
2004-09-27  9:16     ` skaller
2004-09-27  9:43     ` Damien Doligez

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).