Hello I'm trying to generate ocaml documentation with ocamldoc. I'm trying the following command : ocamldoc -html alpha.mli -d doc/
But I have this error :
File "compiler/alpha.ml", line 16, characters 12-23:
Error: Unbound module Id
File "compiler/argHandler.ml", line 3, characters 17-27:
Error: Unbound module Parser
File "compiler/ARMGeneration.ml", line 7, characters 38-41:
Warning 10: this expression should have type unit.
File "compiler/ARMGeneration.ml", line 8, characters 47-59:
Warning 10: this expression should have type unit.
File "compiler/ARMGeneration.ml", line 11, characters 10-33:
Error: Unbound module Exception
File "compiler/ASMLGeneration.ml", line 7, characters 44-60:
Error: Unbound module Syntax
File "compiler/id.ml", line 44, characters 38-61:
Error: Unbound module Exception
File "compiler/knorm.ml", line 11, characters 4-14:
Error: Unbound module Syntax
File "compiler/letfold.ml", line 4, characters 4-15:
Error: Unbound module Syntax
File "compiler/main.ml", line 15, characters 4-24:
Error: Unbound module ArgHandler
File "compiler/regAllocation.ml", line 202, characters 18-29:
Error: Unbound module Id
File "compiler/SyntaxArm.ml", line 8, characters 12-16:
Error: Unbound module Id
File "compiler/syntax.ml", line 20, characters 12-16:
Error: Unbound module Id
11 error(s) encountered
This error will happen when ocamldoc can't locate the .cmi generated by the build.
In order for it to work you need to first compile your project and then point ocamldoc towards the _build/compiler folder where you .cmi are
A valid command for you might look like :
ocamldoc -html -I _build/compiler compiler/*.ml -d doc/
the -I option indicate that you will specify the folder where the .cmi are.
Related
following yaml line of code (Code is at line 10 and line 9 and 11 through 13 are blank where the yaml ends)
bibliography:dcf_bibliography.bib
when knitting to PDF format which knits fine without the line of code
results in this error
messageError in yaml::yaml.load(..., eval.expr = TRUE) :
Scanner error: while scanning a simple key at line 9, column 3 could not find expected ':' at line 12, column 5
Calls: <Anonymous> ... parse_yaml_front_matter -> yaml_load -> <Anonymous>
Execution halted
There is a space missing after the colon. Fix it like this:
bibliography: dcf_bibliography.bib
It is not certain this is the only error as you don't show the whole YAML file.
I have a script I run from terminal, uploading files with gsutil in Centos 7, I receive an error about one of my file names.
Caught non-retryable exception while listing file:///home//:
CommandException: Invalid Unicode path encountered
('/home/mysite/public_html/images/office-100-m\xe2\xb2.jpg').
I checked in python like this (notice the superstring):
>>> "office-100-m²-2.jpg".decode("utf-8")
u'office-100-m\xb2-2.jpg'
It decodes? I was expecting to see an error. When I checked locale
python -c "import locale; print locale.getdefaultlocale()"
('en_US', 'UTF-8')
So what is wrong with it?
That string is not a valid unicode sequence. If you take the bytes and try to decode it, you'll see the error:
>>> s = '/home/mysite/public_html/images/office-100-m\xe2\xb2.jpg'
>>> s.decode('utf-8')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 44-45: invalid continuation byte
Similarly, if you encode the unicode string you have in your question, the encoded bytes are different from what's shown in the error. This is the correct utf-8 encoded version of that string:
>>> u"office-100-m²-2.jpg".encode('utf-8')
'office-100-m\xc2\xb2-2.jpg'
Notice \xc2\xb2 vs. \xe2\xb2. I'm not sure what encoding your filesystem filename is, but it doesn't appear to be UTF-8.
I am trying to implement a genetic algorithm in octave.
My code is http://codepad.org/NeaWqa90
I get the following error:
>> run("a.m")
parse error near line 31 of file /home/teron/a.m
nested functions not implemented in this context
>>> function [x,y]=crossover(x,y)
^
error: called from 'run' in file /usr/share/octave/4.0.0/m/miscellaneous/run.m near line 84, column 5
>>
I do not know how to resolve this error
The error is rather informative, namely the part about "nested functions". For instance, the following gives us the same error.
function fun1
function fun2
end
end
Save this into a text file (eg. temp.m), and run it.
octave:2> run('temp.m')
parse error near line 3 of file /home/me/temp.m
nested functions not implemented in this context
>>> function fun2
^
error: called from 'run' in file /usr/share/octave/3.8.1/m/miscellaneous/run.m near line 80, column 5
I suspect you're missing an end around line 13, but well-formatted code would go a long way.
I am trying to use ren-regexp to replace a character in filenames like so:
./ren-regexp.pl "s/_/-/g" *.jpg
Which I think should replace _ with - in filenames that are jpgs, but what I get is:
./ren-regexp.pl: line 4: syntax error near unexpected token `newline'
./ren-regexp.pl: line 4: `<!DOCTYPE html>'
I also tried
perl ren-regexp.pl "s/_/-/g" *.jpg
Which resulted in lots of errors such as:
Bareword found where operator expected at ren-regexp.pl line 252, near "time class"
(Do you need to predeclare time?)
Bareword found where operator expected at ren-regexp.pl line 252, near ""js-relative-date" datetime"
(Missing operator before datetime?)
Bareword found where operator expected at ren-regexp.pl line 252, near ""2011-04-13T16:40:41-07:00" title"
(Missing operator before title?)
Number found where operator expected at ren-regexp.pl line 252, near "April 13"
(Do you need to predeclare April?)
Bareword found where operator expected at ren-regexp.pl line 262, near ""/msabramo/ren-regexp/tree/17026c762c41e2b88ed91bf78b63e54859b706e5" class"
(Missing operator before class?)
I tried using the examples shown on the GitHub page as well as here:
Mass replace characters in filenames from terminal?
Where am I going wrong? Running just 'perl ren-regexp.pl' by itself also results in the above set of errors.
It looks like you downloaded the script from
https://github.com/msabramo/ren-regexp/blob/master/ren-regexp.pl
instead of
https://raw.github.com/msabramo/ren-regexp/master/ren-regexp.pl
The former link will actually give you an HTML document that is unsuitable for passing into perl.
Or you could view the first link in a browser, and then copy and paste the Perl code to a file (and strip the line numbers).
I've got a source code file, that started as a copy of some sample code from a webpage.
It was created and edited under Windows and compiled with no problems.
But under Mac's I get a load of obscure errors, like:
../MyProgram.cpp:1: error: stray '\255' in program
../MyProgram.cpp:1: error: stray '\254' in program
../MyProgram.cpp:1: error: stray '#' in program
../MyProgram.cpp:3:4: error: invalid preprocessing directive #i
../MyProgram.cpp:5:4: error: invalid preprocessing directive #i
../MyProgram.cpp:7:4: error: invalid preprocessing directive #i
../MyProgram.cpp:23: error: missing terminating ' character
../MyProgram.cpp:369:6: error: invalid preprocessing directive #i
../MyProgram.cpp:371:8: error: invalid preprocessing directive #i
../MyProgram.cpp:375:8: error: invalid preprocessing directive #e
../MyProgram.cpp:381:8: error: invalid preprocessing directive #e
../MyProgram.cpp:383:6: error: invalid preprocessing directive #e
../MyProgram.cpp:385:8: error: invalid preprocessing directive #i
../MyProgram.cpp:389:8: error: invalid preprocessing directive #e
../MyProgram.cpp:1: error: 'i' does not name a type
../MyProgram.cpp:53: error: 'V' does not name a type
../MyProgram.cpp:75: error: 'v' does not name a type
../MyProgram.cpp:157: error: 'l' does not name a type
../MyProgram.cpp:169: error: 'l' does not name a type
../MyProgram.cpp:187: error: 'i' does not name a type
../MyProgram.cpp:197: error: 'v' does not name a type
Looks like the problem is with some special characters.
How can I strip them off with *nix command line?
Looks to me as if the file was saved as UTF-16. Opening it in a text-editor and reencoding to UTF-8 should, with some luck, fix the problem.
Originally I was just going say how to remove the \255 & \254 characters, but I agree with the comments, it's in unicode.
try
iconv -f iso-8859-1 -t utf-8 infile > outfile
iso-8859-1 is just a guess.