[erlang-questions] wx app file parsing error

Jachym Holecek freza@REDACTED
Tue Mar 22 12:37:54 CET 2011


# Joe Williams 2011-03-22:
> Anyone else run into this issue?
> 
> 1> file:consult("/usr/local/lib/erlang/lib/wx-0.98.9/ebin/wx.app").
> {error,{26,erl_parse,
>         ["syntax error before: ","wxAcceleratorTable"]}}
> 
> At least on my system (OSX) it looks like the file contains lines like
> "wxAcceleratorEntry,n    wxAcceleratorTable,n    wxArtProvider,n ...".
> On my linux box it seems fine.

That's because lib/wx/src/Makefile makes an unreasonable assumption that host
OS's "sed" command happens to be the GNU implementation. As a workaround,
change this rule:

  $(APP_TARGET): $(APP_SRC) ../vsn.mk Makefile
	sed -e 's;%GEN_MODS%;$(GEN_MODS);' $< > $@.tmp
	sed -e 's;%VSN%;$(VSN);' $@.tmp > $@
	rm $@.tmp

to use GNU sed instead. Alternatively, change GEN_MODS definition to:

  GEN_MODS        = $(GEN_FILES:gen/%.erl=%,)

(Surely you won't mind wx.app will end up looking less pretty than intended).
Alternatively, just hand-edit wx.app changing ",n" to ",<newline>".

HTH,
	-- Jachym


More information about the erlang-questions mailing list