Resolving Component libs with Flex SDK mxmlc

10,964

Solution 1

Here is a link to the mxmlc command line tool docs from Adobe and a direct link to the command line options reference. I also find mxmlc -help list to be a good place to start.

As another poster recommended, you really want to use library-path to add the path to the directory that contains the swc file. Use the += operator to make sure you don't overwrite the previous values

e.g.)

c:\flex_sdk_3\bin\mxmlc.exe -library-path+=lib coverflow.mxml

Solution 2

If it is an swc shouldn't you be using library-path rather than source-path and referencing the swc?

Share:
10,964
Parappa
Author by

Parappa

Software Developer / Computing Science generalist. Currently employed as a UI developer for a major video game studio. Professional first-hand experience with C, C++, C#, Python, PHP, JavaScript, and Delphi. Have written desktop apps and command line scripts for Windows, FreeBSD, and Linux environments. Hobby programming experience with Ruby, Lisp, Prolog, and Java.

Updated on June 26, 2022

Comments

  • Parappa
    Parappa about 2 years

    I'm new to Flex SDK and trying to implement a simple project using Doug Mccune's CoverFlow widget. Most of the documentation out there on how to do this assumes that one is using Adobe's FlexBuilder product, which is a $250 Eclipse plug-in that I'd rather avoid buying. The problem I'm having is simply getting Doug's swc file, which is the binary version of his component lib, to be recognized by mxmlc, the Flex SDK project compiler. I keep getting error messages such as

    Error: Could not resolve to a component installation

    and

    Error: Type was not found or was not a compile-time constant: CoverFlow.

    I have also tried the type "VideoCoverFlow" as I am pretty sure that these types are defined in Doug's lib. Alas, I am stuck on figuring out where I've gone wrong.

    The following is the full text for my mxml project file, called coverflow.mxml.

    <?xml version="1.0" encoding="utf-8"?>
    
    <mx:Application
        xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:local="*"
        height="100%"
        width="100%"
        layout="absolute">
    
        <local:CoverFlow
            id="CoverFlow"
            horizontalCenter="0"
            verticalCenter="0"
            borderThickness="10"
            borderColor="#FFFFFF"
            width="100%"/>
    
    </mx:Application>
    

    I am trying to compile it with the following command:

    c:\flex_sdk_3\bin\mxmlc.exe -compiler.source-path=lib coverflow.mxml
    

    I have also tried moving the CoverFlow_lib.swc file into the same dir as the mxml file instead of using the source-path argument, but that does not seem to make a difference.

    I would gladly go RTFM if somebody could be so kind as to point me in the direction of the proper docs. There are related Stack Overflow questions here and here.

    Thank you!


    Update: I have changed my build command to the following:

    mxmlc -library-path+=lib coverflow.mxml
    

    And I also tried the following:

    mxmlc -library-path+=CoverFlow_lib.swc coverflow.mxml
    

    With the swc file in the same dir as the mxml file. However, I'm still getting the same errors.

    There's also a video here showing the same library that I'm trying to use, but in Flex Builder. Unfortunately, it doesn't show how to use mxmlc.

    I've also tried stripping down my mxml to simply,

    <mx:Application
        xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:local="*" >
    
        <local:VideoCoverFlow />
    
    </mx:Application>
    
  • James Fassett
    James Fassett over 15 years
    I think it is because you have a xmlns named coverflow so you are filling the files symbol table with two symbols with the same name. You do not need the xmlns:coverflow or the xmlns:local