Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Trouble getting Win32 native port to work
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Travis Nixon <tnixon@a...>
Subject: [Caml-list] Trouble getting Win32 native port to work
I cannot for the life of me get labltk to compile under the native Win32 port.
If I remove labltk from the "other libraries" list, everything is peachy keen
(well, except for the fact that I can't use labltk yet).  Has anybody else had
this problem, and if so, were you able to solve it?  I've tried both 3.01 and
3.02 and there was no difference between the two.

I ran into a couple problems that I was able to solve.  First, the rule to make
io.h (copy it from the system includes) is circular with something else.  I
didn't really take the time to figure out what, I ended up just commenting out
the rule for io.h and copying it manually.  (I don't expect to be changing it
anytime soon) :)

Second, I had to add quotations around the end everywhere -cclib option was
specified because the following:

    -cclib -lunix wsock32.lib

only passes on -lunix as an option to the linker, the wsock32.lib and anything
following goes to the original command.  It should be written like this:


    -cclib "-lunix wsock32.lib"

which gets rather hairy when you also have paths with spaces in them (like, oh,
say, Program Files which is where windows likes to put everything), but I
figured that one out too.  (you can specify the paths in single quotes,
so: -cclib "-lunix 'c:/program files/whoever/wsock32.lib'")

Then I came to a problem I have no clue on.

After those changes, when it got around to doing the final bytecode compile for
labltk, I kept getting the following error:

4NT: /nologo is not a valid command

Or whatever it is 4NT says.  Speaking of which, I'm not positive, but I don't
think the makefiles would work without 4dos or some other shell that understands
the & command concatonation.  I think we had problems with that on another
project, but I don't remember for sure.

Anyway...back to the problem I haven't figured out how to solve:

After quite a lot of digging (and spending quite a bit of time looking at the
same spot in the makefile saying "there is no command anywhere near there that
has the /nologo argument") I think I figured out what's happening.  This error
happens while ocamlrun is using ocamlc to bytecompile and link all the labltk
stuff together.  As far as I can tell, the commands get hardcoded into the
bytecode version of ocamlc, and that's where the command with /nologo is coming
in.  I'm not sure if this is present on the unix side of things, but /nologo is
the command for most of the VC tools to keep it from printing "Hi, I'm Make" or
"Hi, I'm CL, duh".  However, the problem was not the /nologo argument.  It just
happened to be the first argument to the command that wasn't running correctly.
If I look with a hex editor, it's easy to find the few instances of /nologo in
there, and one of them turns out to be %cl /nologo /ML%.  I verified that's
where the command was coming from by changing the text to nolobo.  Now, this is
where I get lost.  Because if it's really running "cl /nologo /ML yadda yadda"
then there shouldn't be a problem.  What it looks like it's actually doing
though is dropping off the cl and trying to run "/nologo /ML" which obviously is
not a valid command.  The command itself comes from BYTECC followed by
BYTECCLINKOPTS in config/Makefile.nt.

Has anybody come across this very bizarre problem before?  I suppose I could use
the Win32 api instead of TK, but it's much easier to put things together quickly
with tk.

Please help, I'm drowning in ocaml....

PS, I had the binary install running perfectly, but if I end up using ocaml at
all, it will be on console game machines, so I sort of need to be able to
recompile.  (although labltk certainly isn't a necessity for that end of things)
:)

While I'm here, I have a quick question.  I had been looking at python
previously, but there are a number of things that scare me half to death about
it.  Primarily the fact that it's dynamically typed.  Combine that with the fact
that I think you can actually have syntax errors in code that's been compiled
but not yet run, and you really have far too many ways to set yourself up for
disaster.

Of course, there were also a number of things that I really liked about python.
For one, it's dynamically typed.  (heh, just kidding.  I really like it for
small things, but for anything large scale, I really think that's the clincher
that would keep me away)  Joking aside, there is one thing I had figured out how
to do very well in python that I don't really see any way to do in ocaml:
dynamically load/unload/reload code without restarting.  It's a little tricky,
and I really only got it working for functions, but with a little more work I
think I could get it to work for objects too.  But even if it only worked for
functions, it could be a huge timesaver in a situation where you're trying to
debug a level that takes 5 minutes to load to your PS2 devsystem across the
network. :)

I'm guessing no, but hopefully somebody will correct me and say there is a way
to dynamically load code into ocaml?  I'm just talking bytecode, not native
compiled code.  Which incidentally is another reason I'm looking at ocaml
instead of python (although I really like python's syntax much more...caml is a
little...er...weird?)  Even if we couldn't get native compiled code on every
platform we are working on, everything I've seen would lead me to believe that
even bytecode ocaml is quite a bit faster than python. :)

Anyway, hoping for some answers from somebody who knows a little more than me.
Especially about the compile problems.


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr