Wings 3D Development Forum
undefined parse transform 'tools' - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Programming (https://www.wings3d.com/forum/forumdisplay.php?fid=7)
+--- Thread: undefined parse transform 'tools' (/showthread.php?tid=2329)



undefined parse transform 'tools' - kugelfang - 01-05-2017

I'm playing around trying to figure out how to compile plugins for Wings. I'm using Linux Mint OS using Erlang/OTP 19. In order to keep things as simple as possible I'm simply calling 'erlc' on the *.erl files to create a *.beam. (I haven't used a compiled language since performing Y2K work in COBOL!)

When I try to compile wpc_collada.erl (and other plugin sources) --after changing paths to point to the correct included sources from my working directory-- I keep getting this error: 'undefined parse transform 'tools''.

so I follow the includes:
-include_lib("wings-2.1.4.1/src/wings.hrl"). ->
-include("../intl_tools/wings_intl.hrl") ->
-compile({parse_transform,tools}).

And I look at the Erlang reference manual to find that :

Quote:{parse_transform,Module}

Causes the parse transformation function Module:parse_transform/2 to be applied to the parsed code before the code is checked for errors.

Now what? Seems to me that 'parse_transform' is part of Erlang itself, not part of Wings. Has there been a change in Erlang/OTP 19 that causes this error?

Thanks,

--jeff


RE: undefined parse transform 'tools' - ggaliens - 01-05-2017

Jeff ... try Change directory into intl_tools directory and build that suite of modules first with its local makefile.

I'm grabbing at straws here ... but it is worth a try.


RE: undefined parse transform 'tools' - dgud - 01-05-2017

Why not type 'make' from the top directory?


RE: undefined parse transform 'tools' - kugelfang - 01-05-2017

Why would I want to use 'make' to compile a single file to move into the Wings plugin directory? Have plugins become so intertwined with the application code that they can't be independently compiled?

I also have to admit that I haven't used 'make' for many years. As a newcomer to Erlang I'd rather focus on learning Erlang and the Wings code base rather than the complexities of the development environment. My modus operandus is always KISS.

There is a parse_transform function in /intl_tools/tools.erl. I can locally compile that without error. I wonder if the error is in reference to this parse_transform rather than the compile function I noted in OP.

I suspect the real issue is that erlc just isn't finding the correct included files. So a env path issue? Does erlc accept some type of path parameter?

--jeff


RE: undefined parse transform 'tools' - dgud - 01-05-2017

Yes it does, which 'make' sets up for you.
See the makefile if you need to know.
What I mean is that it's more simple to use make
than invoking erlc on your own.
The parse transform is used for language strings in translations.
So not needed for your plugin in the beginning but needed for compiling all the other wings src files. Migth be needed when including wings.hrl I don't remember.