3 Replies Latest reply on Jun 11, 2010 11:30 AM by escouten

    Compiling plugins

      How does one do this? The facebook plugin (http://regex.info/blog/lightroom-goodies/facebook) seems to be compiled or at least obfuscated, however, when I attempt to compile my own, it gives me an error. The error given is "Info.lua: bad header in pre-compiled chunk." and I have no idea how to fix this.

      I tried compiling one of the demo plugins, specifically hello world, but it still gave me the same problem. Do I need to use a different version of Lua or do I have to do something completely different? I tried both 5.0 and 5.1.

      All I'm doing is:
      luac -o compiled/Info.lua Info.lua

      Is that good enough, or do I need to do more?

      Thanks a lot.
        • 1. Re: Compiling plugins
          Liukas

          I got the same error with every file I tried to compile and after few frustrating hours I found a workaround.

           

          I'm using OSX 10.6 and I had installed Lua 5.1.4 from MacPorts. At first I thought that something was wrong with my ports install and I removed the MacPorts install and downloaded new 5.1.4 binaries from Lua.org. The luac from those binaries produced the same "Info.lua: bad header in pre-compiled chunk." error (the bad header error came in all compiled files).

           

          I found some posts in other forums mentioning encoding / locale settings causing this type of problem. I opened up my Windows XP (virtual machine) and downloaded the Lua binaries from Lua.org to the windows machine. After compiling the plugins lua-files in windows it worked without a flaw in Windows and Mac.

           

          Something sucks in Luac 5.1.4 + OSX 10.6 + Lightroom 2.8 combination when trying to compile plugins.

           

          So no real answers and only a bad workaround for Mac users....

          • 2. Re: Compiling plugins
            SeanMcCormack Adobe Community Professional

            It's 5.1 AFAIK.

             

            I usually dupe the folder then overwrite each file. To be more precise I copy the directory listing into a text file and create all the compile commands there and then paste the whole thing into the CLI.

            • 3. Re: Compiling plugins
              escouten Adobe Employee

              It's 5.1.2 to be precise ... same version we've used across all versions of Lightroom so far. That said, I don't think it matters which of the 5.1.x versions you use when compiling.

               

              You should stay away from the Lua 5.2 prerelease versions as far as Lightroom is concerned. There are some new language features and I would not expect the byte codes from one to work in the other.