[erlang-questions] Dialyzer problems on Windows

Tobias Lindahl <>
Wed Jun 18 10:30:09 CEST 2008


Hi Robert,

I'm sorry that I didn't foresee this problem. I tend to forget about the 
Windows distribution.

In the Dialyzer chapter of the reference manual the new plt handling is 
described (http://www.erlang.org/doc/apps/dialyzer).

I haven't described how to do the same thing from the Erlang shell since 
I didn't see a need for this, but perhaps there is one on Windows.

Use the dialyzer:run/1 function to perform the analysis to build the 
plt. The instructions are the same as for the command line version in 
the reference manual, but the options for analysis_type are

--add_to_plt       =>  plt_add
--build_plt        =>  plt_build
--check_plt        =>  plt_check
--remove_from_plt  =>  plt_remove

The plt is no longer distributed by default, and the format has changed 
so you cannot use plt:s built with an older Dialyzer.

To build a plt from the same files that used to be in the distributed 
version, the following command should work

dialyzer:run([{files_rec, ["<ERL_TOP>/lib/kernel/ebin",
                            "<ERL_TOP>/lib/stdlib/ebin",
                            "<ERL_TOP>/lib/mnesia/ebin"]},
               {analysis_type, plt_build},
               {output_plt, <PATH>}]).

Once the plt is built, you start the gui with

dialyzer:gui([{init_plt, <PATH>}]).

You can also use the environment variable $DIALYZER_PLT to specify the 
location of the plt, both for builds and for later analyses.

Although it is a bit more work to set up now, you get better control 
over what files to include in the plt. For example, you can add your own 
files to the plt and get them checked for consistency when you analyze. 
Also, you can build a plt for your whole project, and then just use 
--check_plt when something changes, and you will get warnings for the 
changed files (and all files that depend on them). (*)

Hope this helps.

Tobias

(*) Note that the default is to not spit out the warnings when 
manipulating the plt. If you want to get the warnings you need to 
specify --get_warnings (or {get_warnings, true} in the shell version).


Robert Virding wrote:
> I am running R12B-3 on Windows using the standard distribution package from
> erlang.org.
> 
> When I try to run dialyzer from ERlang with dialyzer:gui() I get the
> following error:
> 
> ** exception error: {dialyzer_error,"Please specify which plt to use"}
>      in function  dialyzer:gui/1
> 
> Yes, well, which plt file do I specify? Do I need to make one, and if so
> how? Remember I am running on a limited system. No I don't have cygwin,
> never needed it before.
> 
> I did not get this error with R12B-2.
> 
> Robert
> 
> P.S. I see in R12B-2 there is a plt file on a plt directory. Can I just copy
> that or do I need another one?
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list