Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re: Problems with MS Windows Ocaml-3.00 distribution and LablTk #2438

Closed
vicuna opened this issue May 1, 2000 · 3 comments
Closed

Re: Problems with MS Windows Ocaml-3.00 distribution and LablTk #2438

vicuna opened this issue May 1, 2000 · 3 comments

Comments

@vicuna
Copy link

vicuna commented May 1, 2000

Original bug ID: 100
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)

Bug description

Hi,

Thank you for your message to the Caml mailing list.

However your message seems to be a bug report; hence I send it to the
relevant mailing list

caml-bugs@inria.fr

Thank again for your interest in Caml.

Pierre Weis

INRIA, Projet Cristal, http://pauillac.inria.fr/~weis

[I apologize for the lack of a French version of this message.]

Hello,

I've noticed some problems with the MS Windows Ocaml-3.00 distribution
and LablTk; I've been able to work around them by recompiling the
distribution from scratch, but I thought someone might be interested.

  • The Readme.win32 says that it requires Tcl/Tk 8.0; as
    distributed it actually requires Tcl/Tk 8.3. Moreover, you have to
    installed Tcl/Tk in the specific directory structure LablTk is
    expecting (C:\Tcl), which is not the default installation location
    (at least as-of 8.3).

  • When linking labltk.cma, it looks for a file in the wrong directory:

    ocamlc -c -I /ocaml/lib/labltk -g animgif.ml
    ocamlc -custom -I /ocaml/lib/labltk -g unix.cma str.cma labltk.cma
    -o animgif animgif.cmo
    camlprim0.c
    LINK : fatal error LNK1104: cannot open file "caml/lib/labltk\liblabltk41.lib"
    Error while building custom runtime system

    I don't understand why it is looking for a relative path here.

  • If I copy the directory c:\ocaml\lib\labltk into the directory where
    I'm compiling it finds liblabltk41.lib, but complains about missing
    symbols.

I was able to recompile the distribution from scratch, which seems to
fix the above problems, at least for my (rather small) LablTk programs.

--
T. Kurt Bond, tkb@tkb.mpl.com

@vicuna
Copy link
Author

vicuna commented May 8, 2000

Comment author: administrator

Hello,

  • The Readme.win32 says that it requires Tcl/Tk 8.0; as
    distributed it actually requires Tcl/Tk 8.3. Moreover, you have to
    installed Tcl/Tk in the specific directory structure LablTk is
    expecting (C:\Tcl), which is not the default installation location
    (at least as-of 8.3).

This looks like a bug to me.
At least it should be looking in the default installation location,
and the documentation should say that you have to select the box "install
headers
and library files" during Tcl/Tk installation.

More fundamentally, the autolink feature does not work well on windows, since
there is no standard place to put libraries into, and you have to use them
with absolute paths. The solution might be not to use autolink for add-on
libraries
like Tcl/Tk.

  • When linking labltk.cma, it looks for a file in the wrong directory:

    ocamlc -custom -I /ocaml/lib/labltk -g unix.cma str.cma labltk.cma
    -o animgif animgif.cmo
    camlprim0.c
    LINK : fatal error LNK1104: cannot open file
    "caml/lib/labltk\liblabltk41.lib"
    Error while building custom runtime system

    I don't understand why it is looking for a relative path here.

What happens actually is that ocaml forgets to translate slashes into
backslashes,
and passes directly "/ocaml/bin/labltk\liblabltk41.lib" to the C compiler,
which very naturally tries to put its output in
caml/bin/labltk\liblabkt41.lib...
You can see it by using the -verbose option.
Two easy workarounds:
write the drive letter: -I c:/ocaml/lib/labltk
use backslashes yourself: -I \ocaml\lib\labltk

  • If I copy the directory c:\ocaml\lib\labltk into the directory where
    I'm compiling it finds liblabltk41.lib, but complains about missing
    symbols.

I suspect a variant of the same problem. Again try -verbose to see how the C
compiler is called.

Regards,

Jacques

@vicuna
Copy link
Author

vicuna commented May 8, 2000

Comment author: administrator

Thanks for the information.

T. Kurt Bond, tkb@tkb.mpl.com

@vicuna
Copy link
Author

vicuna commented Nov 6, 2002

Comment author: administrator

Under Windows, the TCL/TK libraries have no conventional location and autolink
doesn't work well. Unclear what to do about it. -XL

As of version 3.06, labltk.cma contains a relative path for tk.lib, and
the user must set the LIB env variable correctly (as stated in README.win32).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant