8 Replies Latest reply on Jul 18, 2006 1:34 PM by ddanone

    Error compiling component from command line

    ddanone Level 1
      I have a folder "ctls" inside it i have a file called "Email.as" and looks like:

      package ctls
      {
      import mx.controls.TextInput;
      import flash.events.Event;
      import mx.validators.EmailValidator;

      public class Email extends TextInput {
      public function Email() {
      ....
      ....

      When i try to make a component with the command line compiler compc
      i get the following error:

      C:\_tmp_\test_swc\ctls\Email.as: Error: A file found in an source-path must have
      the same package structure '', as the definition's package, 'ctls'.


      The comand line i execute is:
      compc -source-path+=ctls -debug=false -o=bin/mylib.swc Email

      How can i solve this?

      Thanks in advance


        • 1. Re: Error compiling component from command line
          Level 7
          Make sure that the "ctls" directory is in the source path.

          Easiest way to do this is to make sure that you are in the parent directory
          of "ctls" when calling compc. From you error message it looks like you
          should be calling compc from the c:\_tmp_\test_swc.

          Can you provide the compc call that you are using if this doesn't work..

          -brent

          "ddanone" <webforumsuser@macromedia.com> wrote in message
          news:e9h2l6$9e5$1@forums.macromedia.com...
          >I have a folder "ctls" inside it i have a file called "Email.as" and looks
          >like:
          >
          > package ctls
          > {
          > import mx.controls.TextInput;
          > import flash.events.Event;
          > import mx.validators.EmailValidator;
          >
          > public class Email extends TextInput {
          > public function Email() {
          > ....
          > ....
          >
          > When i try to make a component with the commandline compiler compc
          > i get the following error:
          >
          >
          > C:\_tmp_\test_swc\ctls\Email.as: Error: A file found in an source-path
          > must
          > have
          > the same package structure '', as the definition's package, 'ctls'.

          >
          > How can i solve this?
          >
          > Thanks in advance
          >
          >
          >
          >


          • 2. Re: Error compiling component from command line
            ddanone Level 1
            I'm compiling from the ctls parent folder:

            C:\_tmp_\test_swc\compc.exe -source-path+=ctls -debug=false -o=bin/mylib.swc Email

            ctls is under the test_swc folder
            • 3. Re: Error compiling component from command line
              Level 7
              The -source-path in this case should be "-source-path+=." instead of "ctls".

              C:\_tmp_\test_swc\compc.exe -source-path+=. -debug=false -o=bin/mylib.swc
              Email

              "ddanone" <webforumsuser@macromedia.com> wrote in message
              news:e9iriu$fes$1@forums.macromedia.com...
              > I'm compiling from the ctls parent folder:
              >
              > C:\_tmp_\test_swc\compc.exe -source-path+=ctls -debug=false -o=bin/mylib.swc
              > Email
              >
              > ctls is under the test_swc folder


              • 4. Re: Error compiling component from command line
                ddanone Level 1
                I get " Error: could not find source for class Email." with the command line
                C:\_tmp_\test_swc\compc.exe -source-path+=. -debug=false -o=bin/mylib.swc
                Email
                • 5. Re: Error compiling component from command line
                  Level 7
                  My bad... you need to use the packaged name of the class to include:
                  ctls.Email

                  "ddanone" <webforumsuser@macromedia.com> wrote in message
                  news:e9j378$pff$1@forums.macromedia.com...
                  >I get " Error: could not find source for class Email." with the
                  >command line
                  > C:\_tmp_\test_swc\compc.exe -source-path+=. -debug=false -o=bin/mylib.swc
                  > Email


                  • 6. Re: Error compiling component from command line
                    ddanone Level 1
                    if i use C:\_tmp_\test_swc\compc.exe -source-path+=. -debug=false -o=bin/mylib.swc
                    ctls.Email

                    then i get the same error: Error: could not find source for class ctls.Email.

                    I'm getting crazy!! On manuals it's easy but Adobe doesn't provide source samples to test the compc compiler.
                    • 7. Re: Error compiling component from command line
                      Level 7
                      So this is my setup:

                      Base directory = c:\flex\bugs\foobar
                      In here I have a directory called "ctls" which contains a simple class
                      called Emails.as (c:\flex\bugs\foobar\ctls\Email.as) that is in the ctls
                      package.


                      $ cd c:/flex/bugs/foobar
                      $ c:/flex/143452/gmc/bin/compc -source-path+=. -debug=false -o=foo.swc
                      ctls.Email
                      Loading configuration file C:\flex\143452\gmc\frameworks\flex-config.xml
                      C:\flex\bugs\foobar\foo.swc (1023 bytes)


                      "ddanone" <webforumsuser@macromedia.com> wrote in message
                      news:e9j64b$t57$1@forums.macromedia.com...
                      > if i use C:\_tmp_\test_swc\compc.exe -source-path+=. -debug=false
                      > -o=bin/mylib.swc
                      > ctls.Email

                      > then i get the same error: Error: could not find source for class
                      > ctls.Email.

                      >
                      > I'm getting crazy!! On manuals it's easy but Adobe doesn't provide source
                      > samples to test the compc compiler.
                      >


                      • 8. Re: Error compiling component from command line
                        ddanone Level 1
                        GREAT, NOW WORKS!!

                        Brent, thank you for your help
                        i'm going to post a comment on the online manual on the compc section showing a working example.

                        Thanks again!!