caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamlopt problem
@ 2006-06-02 20:58 David Allsopp
  0 siblings, 0 replies; 3+ messages in thread
From: David Allsopp @ 2006-06-02 20:58 UTC (permalink / raw)
  To: OCaml List

I'm trying to build the ocamlodbc package under Windows using Cygwin/MinGW.
It's all built and working except that I'm having one problem with the
native library. My question, I think, relates to a misunderstanding with
ocamlopt so I'm hoping someone can point out my error! 

I've adapted the INSTALL_mingw.sh script to issue the following commands:

$ gcc -mno-cygwin -c -DODBC2 -DWIN32 -I $OCAMLLIB/caml -I
/usr/include/w32api ocaml_odbc_c.c
$ gcc -mno-cygwin -shared -L $OCAMLLIB -L $OCAMLLIB/../bin -o
dllocamlodbc.dll ocaml_odbc_c.o -lodbc32 -locamlrun 

$ ocamlopt -a -o ocamlodbc.cmxa ocaml_odbc_c.o ocaml_odbc.ml ocamlodbc.mli
ocamlodbc.ml -cclib -lodbc32
$ cp ocamlodbc.cmxa ocamlodbc.a ocamlodbc.cmi $OCAMLLIB

$ ocamlc -a -o ocamlodbc.cma ocaml_odbc.ml ocamlodbc.mli ocamlodbc.ml -dllib
-locamlodbc
$ cp ocamlodbc.cmi ocamlodbc.cma $OCAMLLIB
$ cp dllocamlodbc.dll $OCAMLLIB/stublibs

The top-level library ocamlodbc.cma is working exactly as I'd expect. I then
attempt to compile a program that uses the native library (in this case
Exemples/monitor.ml) with the command

ocamlopt -o monitor.exe ocamlodbc.cmxa monitor.ml

but get the response

gcc: ocaml_odbc_c.o: No such file or directory
Error during linking

Despite trying various -ccopt flags, the only way I can make it compile is
to copy ocaml_odbc_c.o to the current directory. My understanding is that
the ocamlopt statement that built ocamlodbc.cmxa should have included
ocaml_odbc_c.o so why is gcc getting a linker problem when referencing the
library?

Sorry if it's a blindingly obvious mistake...


David


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

* ocamlopt problem
  2005-10-06  6:55 Rasool Karimi
@ 2005-10-06  7:07 ` Rasool Karimi
  0 siblings, 0 replies; 3+ messages in thread
From: Rasool Karimi @ 2005-10-06  7:07 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 810 bytes --]

Dear all freinds,
When I compile a .ml file with ocamlopt compiler, an error message is shown
with this message:"Der Befehl "as" ist entweder falsch geschrieben oder
konnte nicht gefunden werden, Assembler error, input left in file
C:\DOKUME~1\karinu\LOKALE~1\Temp\camlasm9312 7a.s". Part of this message is
in german and translation of it in english is : "The instruction "as" is
either wrongly written or could not not be found". But when I compile a .mli
file, this message is not shown and file is compiled successfully. Also when
I compile a .ml file with ocamlc compiler, there is no error and compilation
is done successfully. So there is not error in my program and this error
maybe is related to ocamlopt compiler.
Is there any body who can help me? It is very emergent.
Thanks,
Karimi.

[-- Attachment #2: Type: text/html, Size: 933 bytes --]

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

* ocamlopt problem
@ 2005-10-06  6:55 Rasool Karimi
  2005-10-06  7:07 ` Rasool Karimi
  0 siblings, 1 reply; 3+ messages in thread
From: Rasool Karimi @ 2005-10-06  6:55 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 810 bytes --]

Dear all freinds,
When I compile a .ml file with ocamlopt compiler, an error message is shown
with this message:"Der Befehl "as" ist entweder falsch geschrieben oder
konnte nicht gefunden werden, Assembler error, input left in file
C:\DOKUME~1\karinu\LOKALE~1\Temp\camlasm9312 7a.s". Part of this message is
in german and translation of it in english is : "The instruction "as" is
either wrongly written or could not not be found". But when I compile a .mli
file, this message is not shown and file is compiled successfully. Also when
I compile a .ml file with ocamlc compiler, there is no error and compilation
is done successfully. So there is not error in my program and this error
maybe is related to ocamlopt compiler.
Is there any body who can help me? It is very emergent.
Thanks,
Karimi.

[-- Attachment #2: Type: text/html, Size: 872 bytes --]

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

end of thread, other threads:[~2006-06-02 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-02 20:58 ocamlopt problem David Allsopp
  -- strict thread matches above, loose matches on Subject: below --
2005-10-06  6:55 Rasool Karimi
2005-10-06  7:07 ` Rasool Karimi

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