* [Caml-list] Porblem with Num module
@ 2004-05-13 14:30 Claudio Trento
2004-05-13 15:14 ` Richard Jones
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Claudio Trento @ 2004-05-13 14:30 UTC (permalink / raw)
To: caml-list
I`ve included the line "open Num" at the begin of my test.ml file to use
the Num module. Maybe it's not enough because I've this type of error in
cmpilation:
"Error while linking test.cmo: Reference to undefined global `Num'"
Probably I forget something, someone could say me where I mistake?
Thanks,
Claudio
-------------------
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] 7+ messages in thread
* Re: [Caml-list] Porblem with Num module
2004-05-13 14:30 [Caml-list] Porblem with Num module Claudio Trento
@ 2004-05-13 15:14 ` Richard Jones
2004-05-13 15:39 ` briand
2004-05-14 8:26 ` Virgile Prevosto
2 siblings, 0 replies; 7+ messages in thread
From: Richard Jones @ 2004-05-13 15:14 UTC (permalink / raw)
To: Claudio Trento; +Cc: caml-list
On Thu, May 13, 2004 at 04:30:19PM +0200, Claudio Trento wrote:
> I`ve included the line "open Num" at the begin of my test.ml file to use
> the Num module. Maybe it's not enough because I've this type of error in
> cmpilation:
>
> "Error while linking test.cmo: Reference to undefined global `Num'"
>
> Probably I forget something, someone could say me where I mistake?
Is there a file called 'num.cma' or 'num.cmxa' in your /usr/lib/ocaml/
directory? You probably need to link with it.
Rich.
--
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
PTHRLIB is a library for writing small, efficient and fast servers in C.
HTTP, CGI, DBI, lightweight threads: http://www.annexia.org/freeware/pthrlib/
-------------------
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] 7+ messages in thread
* [Caml-list] Porblem with Num module
2004-05-13 14:30 [Caml-list] Porblem with Num module Claudio Trento
2004-05-13 15:14 ` Richard Jones
@ 2004-05-13 15:39 ` briand
2004-05-15 6:00 ` William Lovas
2004-05-14 8:26 ` Virgile Prevosto
2 siblings, 1 reply; 7+ messages in thread
From: briand @ 2004-05-13 15:39 UTC (permalink / raw)
To: Claudio Trento; +Cc: caml-list
It's in the manual (just for future reference).
If you are using a system which supports dynamic linking you can just do
#load "num.cma";;
if you are using windows which does not support dynamic linking you will
have to compile.
ocamlc other_options num.cma other_files
Or make your own top-level which includes num:
ocamlmktop -o mytop num.cma
./mytop
Brian
P.S. In the manual it actually lists the filename as "nums" not "num".
Is this a documentation bug ?
>>>>> "Claudio" == Claudio Trento <trento@di.unipi.it> writes:
Claudio> I`ve included the line "open Num" at the begin of my
Claudio> test.ml file to use the Num module. Maybe it's not enough
Claudio> because I've this type of error in cmpilation:
Claudio> "Error while linking test.cmo: Reference to undefined
Claudio> global `Num'"
Claudio> Probably I forget something, someone could say me where I
Claudio> mistake?
Claudio> Thanks, Claudio
Claudio> ------------------- To unsubscribe, mail
Claudio> caml-list-request@inria.fr Archives: http://caml.inria.fr
Claudio> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ:
Claudio> http://caml.inria.fr/FAQ/ Beginner's list:
Claudio> http://groups.yahoo.com/group/ocaml_beginners
-------------------
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] 7+ messages in thread
* Re: [Caml-list] Porblem with Num module
2004-05-13 14:30 [Caml-list] Porblem with Num module Claudio Trento
2004-05-13 15:14 ` Richard Jones
2004-05-13 15:39 ` briand
@ 2004-05-14 8:26 ` Virgile Prevosto
2 siblings, 0 replies; 7+ messages in thread
From: Virgile Prevosto @ 2004-05-14 8:26 UTC (permalink / raw)
To: Claudio Trento; +Cc: caml-list
Le jeudi 13 mai, à 16h30 +0200,
Claudio Trento a écrit:
> I`ve included the line "open Num" at the begin of my test.ml file to
> use the Num module. Maybe it's not enough because I've this type of
> error in cmpilation:
>
> "Error while linking test.cmo: Reference to undefined global `Num'"
>
> Probably I forget something, someone could say me where I mistake?
>
Hello,
I suppose you're talking about the Num library described in the ocaml
manual at <http://pauillac.inria.fr/ocaml/htmlman/manual036.html>. As
mentionned there, you have to add nums.cma to the command line for the
linking phase. This is not needed for the compilation itself (-c option
of the compiler):
ocamlc -c test.ml
ocamlc nums.cma test.cmo
should work (you may have to add other .cm[o/a] files on the second
line depending on what's in test of course).
In addition, note that there is a subtle difference between the name of
the file providing the library (nums.cma), and one of the module of this
library (Num, without 's').
Hope this helps,
--
E tutto per oggi, a la prossima volta
Virgile
-------------------
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] 7+ messages in thread
* Re: [Caml-list] Porblem with Num module
2004-05-13 15:39 ` briand
@ 2004-05-15 6:00 ` William Lovas
2004-05-15 6:20 ` Shawn Wagner
0 siblings, 1 reply; 7+ messages in thread
From: William Lovas @ 2004-05-15 6:00 UTC (permalink / raw)
To: caml-list
On Thu, May 13, 2004 at 08:39:43AM -0700, briand@aracnet.com wrote:
> P.S. In the manual it actually lists the filename as "nums" not "num".
> Is this a documentation bug ?
No -- `nums.cma' is the name of the library file. It contains several
modules: Num, Big_int, Ratio... (others? I'm not sure how to analyze a
.cma file to see what it contains other than by trial and error...)
cheers,
William
-------------------
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] 7+ messages in thread
* Re: [Caml-list] Porblem with Num module
2004-05-15 6:00 ` William Lovas
@ 2004-05-15 6:20 ` Shawn Wagner
2004-05-15 10:02 ` Richard Jones
0 siblings, 1 reply; 7+ messages in thread
From: Shawn Wagner @ 2004-05-15 6:20 UTC (permalink / raw)
To: caml-list
On Sat, May 15, 2004 at 02:00:03AM -0400, William Lovas wrote:
> No -- `nums.cma' is the name of the library file. It contains several
> modules: Num, Big_int, Ratio... (others? I'm not sure how to analyze a
> .cma file to see what it contains other than by trial and error...)
Though it's not normally built in a standard ocaml install, there's a
program called objinfo that will display information about bytecode files,
including a list of every module in a .cma file. Run 'make objinfo' in
OCAML-SOURCE/tools/ to compile it.
--
Shawn Wagner
shawnw@speakeasy.org
-------------------
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] 7+ messages in thread
* Re: [Caml-list] Porblem with Num module
2004-05-15 6:20 ` Shawn Wagner
@ 2004-05-15 10:02 ` Richard Jones
0 siblings, 0 replies; 7+ messages in thread
From: Richard Jones @ 2004-05-15 10:02 UTC (permalink / raw)
To: caml-list
On Fri, May 14, 2004 at 11:20:01PM -0700, Shawn Wagner wrote:
> On Sat, May 15, 2004 at 02:00:03AM -0400, William Lovas wrote:
>
> > No -- `nums.cma' is the name of the library file. It contains several
> > modules: Num, Big_int, Ratio... (others? I'm not sure how to analyze a
> > .cma file to see what it contains other than by trial and error...)
>
> Though it's not normally built in a standard ocaml install, there's a
> program called objinfo that will display information about bytecode files,
> including a list of every module in a .cma file. Run 'make objinfo' in
> OCAML-SOURCE/tools/ to compile it.
If you're using Debian, then program should be installed and called
'ocamlobjinfo'. It's very useful - should be installed by default
everywhere I think.
Rich.
--
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
C2LIB is a library of basic Perl/STL-like types for C. Vectors, hashes,
trees, string funcs, pool allocator: http://www.annexia.org/freeware/c2lib/
-------------------
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] 7+ messages in thread
end of thread, other threads:[~2004-05-15 10:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-13 14:30 [Caml-list] Porblem with Num module Claudio Trento
2004-05-13 15:14 ` Richard Jones
2004-05-13 15:39 ` briand
2004-05-15 6:00 ` William Lovas
2004-05-15 6:20 ` Shawn Wagner
2004-05-15 10:02 ` Richard Jones
2004-05-14 8:26 ` Virgile Prevosto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox