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

Problem with ocamlmktop in native win32 #2790

Closed
vicuna opened this issue Jun 16, 2001 · 4 comments
Closed

Problem with ocamlmktop in native win32 #2790

vicuna opened this issue Jun 16, 2001 · 4 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jun 16, 2001

Original bug ID: 387
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

I installed the native win32 version of O'Caml 3.01 on a Windows NT
(v.4) PC. The basic top-level ocaml worked just fine. But when I
tried to build a new top-level containing the str library:

ocamlmktop -o ocamlstr str.cma

from a Cygwin bash shell, I got the following error message:

/c: /c: No such file or directory

What was wrong?

I should point out that, because I didn't have enough space on the C:
drive, I installed O'Caml under D: drive; the complete path of the
O'Caml directory was D:\caml\ocaml-3.01-win. Also, the value of the
environmental variable CAMLLIB in the bash shell was
'd:/caml/ocaml-3.01-win/lib'.

Thanks in advance!

  • Ching Tsun
@vicuna
Copy link
Author

vicuna commented Jun 18, 2001

Comment author: administrator

I installed the native win32 version of O'Caml 3.01 on a Windows NT
(v.4) PC. The basic top-level ocaml worked just fine. But when I
tried to build a new top-level containing the str library:

ocamlmktop -o ocamlstr str.cma

from a Cygwin bash shell, I got the following error message:

/c: /c: No such file or directory

What was wrong?

No idea. To help track down the problem, you could first try to issue
the same command from a Windows shell ("cmd" window). Cygwin does a
lot of weird things when calling a native Win32 executable.

You could also try the following commands:

    ocamlc -v
    ocamlmktop -v

(should print the location of the standard library)
ocamlmktop -verbose -o ocamlstr str.cma
(will print the invocation of the C compiler)

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Jun 18, 2001

Comment author: administrator

Hi Xavier,

I installed the native win32 version of O'Caml 3.01 on a Windows NT
(v.4) PC. The basic top-level ocaml worked just fine. But when I
tried to build a new top-level containing the str library:

ocamlmktop -o ocamlstr str.cma

from a Cygwin bash shell, I got the following error message:

/c: /c: No such file or directory

What was wrong?

No idea. To help track down the problem, you could first try to issue
the same command from a Windows shell ("cmd" window). Cygwin does a
lot of weird things when calling a native Win32 executable.

I tried it and it worked (but only after I got the path right in NT shell):

D:>ocamlc -v
The Objective Caml compiler, version 3.01
Standard library directory: d:\caml\ocaml-3.01-win\lib

D:>ocamlmktop -v
The Objective Caml compiler, version 3.01
Standard library directory: d:\caml\ocaml-3.01-win\lib

D:>ocamlmktop -verbose -o ocamlstr str.cma

  • cl /nologo /MT /Feocamlstr.exe -Id:\caml\ocaml-3.01-win\lib
    C:\temp\camlprim0
    .c d:\caml\ocaml-3.01-win\lib\libstr.lib
    d:\caml\ocaml-3.01-win\lib\libcamlrun.l
    ib wsock32.lib
    camlprim0.c

D:>ocamlstr
Objective Caml version 3.01

Str.regexp;;

  • : string -> Str.regexp =

#quit;;

D:>

The resulted "ocamlstr" can be invoked from both Windows shell and Cygwin
bash.
However, the same commands still don't work from Cygwin bash:

~ <506> ocamlc -v
The Objective Caml compiler, version 3.01
Standard library directory: d:/caml/ocaml-3.01-win/lib
~ <507> ocamlmktop -v
/c: /c: No such file or directory
~ <508> ocamlmktop -verbose -o ocamlstr str.cma
/c: /c: No such file or directory

Also, I got the same error msg when I tried to generate an executable by
linking several bytecode files:

~/extract-tables <502> make bin-cmo
ocamlc str.cma -c tag_parser.mli
ocamlc str.cma -c tag_parser.ml
ocamlc str.cma -c tag_lexer.ml
ocamlc str.cma -c table.ml
ocamlc str.cma -c table_parser.mli
ocamlc str.cma -c table_parser.ml
ocamlc str.cma -c table_lexer.ml
ocamlc str.cma -c extract-tables.ml
ocamlc str.cma -o extract-tables
tag_parser.cmo tag_lexer.cmo
table.cmo table_parser.cmo table_lexer.cmo
extract-tables.cmo
/c: /c: No such file or directory
Error while building custom runtime system
make: *** [bin-cmo] Error 2

Any idea how I can make it to work in Cygwin? It will be very painful if I
have to invoke the compiler in NT shell (e.g., no "make" to use).

Thanks in advance!!!

  • Ching Tsun

@vicuna
Copy link
Author

vicuna commented Jun 19, 2001

Comment author: administrator

However, the same commands still don't work from Cygwin bash:
~ <506> ocamlc -v
The Objective Caml compiler, version 3.01
Standard library directory: d:/caml/ocaml-3.01-win/lib
~ <507> ocamlmktop -v
/c: /c: No such file or directory

Check the COMSPEC environment variable. It should point to the Windows
shell (e.g. C:\WINNT\system32\cmd.exe), not to bash.

(Explanation: the Win32 version of OCaml executes other commands via
$COMSPEC /c "command to execute"
which is the proper syntax for the Windows shells, but not for Bash.)

Any idea how I can make it to work in Cygwin? It will be very painful if I
have to invoke the compiler in NT shell (e.g., no "make" to use).

There are plenty of "make" commands for Windows, e.g. Microsoft's nmake.
I agree with you that Cygwin is a much more comfortable environment,
however it doesn't work very well with non-Cygwin tools.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Jun 21, 2001

Comment author: administrator

User's problem (COMSPEC variable).

@vicuna vicuna closed this as completed Jun 21, 2001
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant