Automation of OMC in a Cascades library project?

Hello

It seems MetaObject compiler (MOC) is not automatically configured in a static or dynamic new Cascades library under project of BlackBerry models in Momentics.

Many others have had problems because of this, and no one answered them correctly:

1. http://supportforums.blackberry.com/t5/Cascades-Development/QObject-and-Signals-and-Slots-in-static-...

2. http://supportforums.blackberry.com/t5/Cascades-Development/Creating-a-shared-library/td-p/2005535

3. http://supportforums.blackberry.com/t5/Native-Development/Making-a-Qt-Cascades-library/td-p/1722731

EDIT: 4. same problem acknowledged, with a link broken to a solution in the form of 'hack' Python script to call OMC

The code compiles, but linking the library causes the application related compilation errors.

This is a major drawback, if you want to use any QObject Associates classes (SLOTS, SIGNALS, etc.)
And running OMC myself outside Momentics is painful.

The closest thing to a solution seems to be out of date and a hack at best: http://supportforums.blackberry.com/t5/Native-Development/Making-a-Qt-Cascades-library/m-p/1725399#M...

Please could someone put this topic to bury once and for all?

Thank you in advance and I once again thank you if you have any tips!

-Frosty

Hello.

Now, Momentics has not a model for a waterfalls or Qt shared library but we work closely with the team of tooling to fill this gap.  In the meantime, please use this template on GitHub to serve as the basis for your shared library project.  Please let me know if you encounter any problems.

https://github.com/BlackBerry/Cascades-community-samples/tree/master/Cascades-library-template

Tags: BlackBerry Developers

Similar Questions

  • Packed error Library Project: contains the compiled code

    I have tried to understand how the packed library works for LVOOP, but facing a wall with an error and do not know how to solve.

    (i) I did a "class 1", I then put in a library called 'library'.

    (II) I create a library packed and put the top-level library source files

    (III) once compiled and registered, I create a new project and add creating newly packed library project to it. Secondly, I add one newly create class, named 'class 2 '.

    (IV) I put the legacy of class 2 as a child of the class 1.

    (v) select new VI for substitution

    (VI) get error 1035

    What I'm doing wrong or how to fix this?

    The default setting for the packaging of screws in lvlibp deletes the block diagram.

    You must not delete dynamic distribution pattern-block screw you wish to override.

    hope this helps,

    Norbert

  • Conversion of a project to use a library project

    Hello.

    I'm trying to convert a large main VI with a lot of sub - VI to a project that would use rather a project library. In particular, I want to pack all or nearly all my SubVIs in a library project (so that I can later reuse these subVIs to various projects) and the main VI would use this library. I hope I have the idea of libraries in the project correctly.

    Now, I thought I'll Pack all my subVIs in a library project and save it as ProjectLib, so I'll create a new project with my main VI and add ProjectLib to this project.

    Here is my ProjectLib with virtual for subVIs folders and Utils (Utils are just more generic subVIs)

    and here is my main project VI, with the library of projects above added:

    Now, I'm sure I'm doing this wrong, but I can't know what would be the right way to go about this, despite reading and re-reading helps LabView to articles on the issue (like this: http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/project_libraries/). Nowhere can I find a guide step by step conversion my VI existing with a lot of subVIs to this structure.

    For example, when I opened my main VI now, I see errors caused by all the missing of subVIs. My thought is that I now say my main VI: ' look, this is a ProjectLib I have included, see? Take this Subvi from there! "but I don't see an option for this.

    I would be grateful any ellucidation on how do properly what I'm trying to do. I apologize in advance for any stubbornness on my part.

    Thanks in advance.

    Hello SenSLabs,

    It seems that you are attempting to add a project (lvproj) to another project, rather than building a library (lvlib or lvlibp) and adding that the new project.  The easiest way to build a standard .lvlib is described here:

    LabVIEW Help: Creating a library to a project folder project

    http://zone.NI.com/reference/en-XX/help/371361J-01/lvhowto/convert_fold_lib/

    Once you have built the lvlib (from the old project), add this library in your project (new) and you should be good to go.

    Kind regards

  • Open VI refers to a VI library project

    Hello

    my code name some subVIs by reference using "Open Reference VI" and "Call by reference" live now, 'Open VI référence' expects a path to VI:

    When the SubVIs sit in the same folder as the appellant VI, it is easy to simply provide the name of the Subvi. However, I want to call a Subvi, which is part of a project of library sitting somewhere else on the disk. I could give the relative path, but this make the fairly rigid code and if the relative path changes all paths will have to be changed. Ideally, I'd like to use the fact that I am using a library project. Assistance to open VI precise than reference

    path of the VI accepts a string containing the name of the VI that you want to reference or a path to the VI that you want to reference. If connect you to a name string, the string must be delimited name of a VI in memory on this target. If you wire up a path, LabVIEW VI searches the memory that you have previously loaded this path on the same target.

    I thought that the path pointed out my ticket and tried something like this:

    but it did not work and I got

    "Error 1004 to reference VI opened in MainVI.vi:

    Possible reasons:
    LabVIEW: The VI isn't in memory.
    To load a VI in open with the function of reference VI memory, a path must be wired for the entrance to the path of the VI. »

    Wiring of a path is not desirable according to the reasoning above. Is there a way around the problem?

    Thanks in advance!

    It should work, but you must pay attention to something that is indicated in the help and in error: If you use a string, the only way for BT to know what to access if that something is already "in memory" (sometimes also referred to as "loading"). In the case of the standard libraries, this means that the VI itself or one of its callers should be charged. In the case of classes and XControls, loading the library (as in having it in an open project) should be enough to load all its members.

    What I usually do is use a static reference to a VI to get his name; that assures that he will be linked statically, included in the executable files, etc. Which may not work for you, if you want the dynamic loading and then you will need to use other means. Something I did when I needed something like that was to have a VI another which would always be in the same folder that the VI I wanted to load and then I had a relative path from that, but brings back you to the same problem where you might only screws.

  • PROBLEM: getting the translations of Cascades library

    I have problems to get translations from my library to application project project

    Thanks to Isaac Gordetzky, the library model was a great starting point and I got some more tips from him

    So in the meantime, I've solved some taks:

    1 library Project creates translation files

    I had to add a skeleton bar - descriptor.xml for the library project and add my local it

    2. get a tr() work in C++

    I had to replace

    TR ("...")

    with
    QT_TRANSLATE_NOOP("My::namespace::MyClass","...")

    3. use of QRC

    In my .pro I inserted

    RESOURCES += baasParseLibrary.qrc

    where baasParseLibrary is my name of the library

    This is the content of baasParseLibrary.qrc:

    
    
    
    translations/baasParseLibrary_de.ts
    translations/baasParseLibrary_en.ts
    
    
    

    4 initialize the QRC in my application

    In main.cpp, I inserted before the Application has been created

    Q_INIT_RESOURCE (baasParseLibrary);

    5. provide the translator of my library code

    Add a method to the API from my library:

    void MyLibApp::updateTranslations() {
    static QTranslator * m_pTranslator = new QTranslator(
            QCoreApplication::instance());
    QString locale_string = QLocale().name();
    QString file_name = QString(":/baasParseLibrary/translations/baasParseLibrary_%1").arg(locale_string);
    if (m_pTranslator->load(file_name, "app/native/qm")) {
        QCoreApplication::instance()->installTranslator(m_pTranslator);
    } else {
        qDebug() << "cannot load " << file_name;
    }
    }
    

    Then, my app, I'll call updateTranslations()

    PROBLEM:

    the file updateTranslations() cannot be loaded into the translator.

    so there must be something wrong.

    Question: the prefix and file in the correct QRC file?

    prefix /baasParseLibrary is the name of the library project in the workspace - not the physical location on disk

    in updateTranslations() I am the same way by referring

    Or am I missing something else?

    I never hepatitis did something with the QRC or translations of libraries before.

    all other things work - getting active such as the images in the library

    Thanks for the tips

    Hi Isaac,.

    Thanks for your tip. You're right, I should use the *.qm files in the file of the QRC. because they have been compiled in the process of generation of library before .qm.

    Then I got the libraray of loaded files. (Both: APP and LIB)

    But still has no translations.

    tried many variations and then found the reason. We changed all the

    tr("..")
    

    in

    QT_TRANSLATE_NOOP("ekkescorner::parse::ParseREST","...")
    

    Let the libraray compile without error

    It does not work as I discovered today.

    But I remembered that you mentioned a second notation that might help.

    And YES: now we'll find translations if you use

    ::ekkescorner::parse::ParseREST::tr("...")
    

    curious: the two create exactly the same content in the *.ts files, but only the last works.

    ... will blog about all this later when to publish my Libraray Parse.com for waterfalls on Github.

    --------

    Finally, I want to check my code is correct to add the two translators.

    Here are the usual stuff generated by the waterfalls inside the APP project model:

    void ApplicationUI::onSystemLanguageChanged() {
        QCoreApplication::instance()->removeTranslator(m_pTranslator);
        // Initiate, load and install the application translation files.
        QString locale_string = QLocale().name();
        QString file_name = QString("baasParseTest_%1").arg(locale_string);
        if (m_pTranslator->load(file_name, "app/native/qm")) {
            QCoreApplication::instance()->installTranslator(m_pTranslator);
            qDebug() << "load translator file from APP: " << file_name;
        } else {
            qDebug() << "cannot load " << file_name;
        }
        mServer->updateTranslations();
    }
    

    as you see after the first initialization of the app translator, I call the library:

    void ParseREST::updateTranslations() {
        static QTranslator * m_pTranslator = new QTranslator(
                QCoreApplication::instance());
        QCoreApplication::instance()->removeTranslator(m_pTranslator);
        QString locale_string = QLocale().name();
        QString file_name = QString(":/baasParseLibrary/translations/baasParseLibrary_%1").arg(locale_string);
        if (m_pTranslator->load(file_name)) {
            QCoreApplication::instance()->installTranslator(m_pTranslator);
            qDebug() << "load translator file from LIB : " << file_name;
        } else {
            qDebug() << "cannot load " << file_name;
        }
    }
    

    and the debug, I see:

    INFO load the APP translator file: 'baasParseTest_de_DE. '

    INFO load file of the translator of LIB: ': / baasParseLibrary/translations/baasParseLibrary_de_DE.

    and translations of C++ and QML are now working.

    I wonder about the removeTranslator() - the call of methods and thought, that the second he would remove the first. but it seems that you are right and I have to remove always.

    ... Thanks again... next step done using waterfalls providing libraries not only C++ code but also translations and assets such as images

  • Help combining Library project Application project .cod

    Hello

    I developed a BlackBerry app for 5.0 using the JDE Eclipse.  I have my main application, MyProject project, so a library project, MyLibrary.

    MyLibrary is configured to start automatically when the device turns on.

    Now I have do some customer acceptance testing, I need an easy way to distribute the application (mainly online).  I packed up and signed applications.  However, it's a pain to have to install the MyLibrary project first and then installing the MyProject.

    So, I tried to add the MyProject.jad to the MyLibrary.jad using the tool UpdateJad.exe.  However, I have had no success.  I get a message that I'm missing MyProject - 3.cod (which does not exist).

    Someone can offer me please help?  Perhaps show a little example on exactly which files are needed and how to combine them with UpdateJad.exe?  I've seen other posts on this topic but none helped.

    Thank you!

    Thanks for the link, it is certainly useful.

    I thought that my problem - is that the tool UpdateJad.exe was not in the same directory as all of my .cod and .jad files...

    Thank you!

  • include the library project

    Hello

    Please excuse if this is a stupid question, but all this stuff of C++ is really new for my java developer experiences.

    I created a project C++ Library of BB mylibproject

    with a public folder inside

    then I copied in the public record of this project: my_lib_test.h

    Then I have another mytestproject of normal C++ BB project

    ricght-click-Configure-add-library: added the public record of mylibproject

    then in my main.cpp I've included

    #include

    I could use the library with content injection and open declaration jumps inside the my_lib_test.h inside main() {}

    If everything seems to work

    then the two selected projects and-> Build Project...

    all compiles without error, but I get an error:

    / Developer/SDKs/bbndk-10.0.4-beta/host/macosx/x86/usr/bin/ntoarm-ld: could not find lmylibproject.

    no idea what could be the problem?

    MyTestProject is a project to mylibproject reference

    THX

    uuups... was my fault

    within my library project, there were 2 files of CBC:

    / SRC

    / public

    / SRC was empty and / public contains xxx.h

    creating a class dummi Interior/SRC fixed - now the library has been recognized.

    .. good lessons to learn new environments ;-)

  • With the help of QNX classes in a Flex library project

    In order to deploy on multiple platforms, I'm building my application "headless"; changes of main application based on the OS class, I'm to deploy, but the underlying library remains the same. I have my classes of library in their own Flex library project and specific classes of Playbook in their own project. Currently I can not all classes of QNX to appear inside my library project, but they appear fine in my main application project. I have the main application and library using the Playbook SDK 0.9.1 projects.

    Is there something special I need to do for a project of library in QNX classes, or am I missing something obvious? Thank you!

    Hey,.

    the screenshots that I showed you were from my application for flash builder 4.5 burrito. If the menus are a little different. It's my flash builder 4.0.1 application menu:

    and with libraries extended:

    from the looks of things, your SDK have not installed or is not read correctly. you follow and do all according to the start-up for windows guide? Good luck!

  • Creation of a library project in Eclipse using a 3rd party library

    Hello

    I am new to BB development so I hope someone can help me please. I develop my BB application using the plug-in for Eclipse 1.1.2 BB and Eclipse 3.5. I have a master project of UiApplication and some other type lilbrary projects that my main application is dependent on. However, I now need to use a third-party library. I added an external jar file to the main application and if he compiled I get an error when I tried to run in a simulator that the module is not found.

    So my main question is how to do, you use a third-party jar file? I searched the forums and found tips using Ant tools but I prefer to do it in the breast of eclipse or a tutorial, but this implies to use BB IDE but I would perfer to use Eclipse. I thought about it and found a suggestion to create a library project using the 3rd party jar file, but how does that happen? I added a lib folder to a project and the jar file, but I still had to add the jar file to my main application's java build path. To remedy this, I added the jar file in a src folder and made my main application dependent on the library project. However, when he tries to build it said the auditor does not, but I don't know where it is called for.

    I have a jar, cod and alx and jad for a third file. Please help, I am sure that this should be much easier that it turns!

    Since you already have the cod file, you can manually load the file of cod for your library of third party on the simulator by clicking the file menu in the upper corner of the Simulator window.

    Afterwards, when the deployment you need to regroup cod library third party distribution with your application folder AND add the additional appropriate lines in the making .jad file.

    (You need permission to do with third-party library).

    If you need to compile the .jar file in a .cod file so you can find instructions to do it here: http://developers.sun.com/mobility/midp/articles/blackberrydev/#4

    I hope this helps.

  • Cannot sign the library project

    I am a library project named Ksoap2 containing just the Ksoap2.jar for my main project and it works well on the Simulator, I can get the values of webservices. I try to deploy the project to a real device and test it, and an error is that ksoap2. COD must be signed, so I try to sign my projects. After you have installed 3 RIM csi files, I can sign my main project successfully, but not the library Ksoap2 project and I have this:

    File: Ksoap2.cod

    Status: Not registered

    Category: required

    SignerID: 3

    Name: RIMAPPSA2

    And then I tried with another jar for the library project, the results are the same, the status is not saved. Someone can help me, thank you very much!

    Third-party applications are not able to call regardess period, native methods if they are signed or not with signature keys.

    The native reference to the call should be deleted.

  • Impossible to debug a library project

    I have programmed a Blackberry CLDC project relying on two Blackberry library projects included in the application through the Eclipse Java Build Path project. When I start the app in the Blackberry Simulator, I am able to debug the code of one of the two projects of library, but not the other. Breakpoints in the library are ignored, and if I try to enter this library method calls, the debugging process freezes.

    It all works very well with the other library.

    Someone has encountered this or knows how to solve?

    I'm programming with the Blackberry Eclipse Plugin under the component pack 4.3.0.13

    I solved the problem: I had renamed the library sooner, while the Simulator had two containnig different cod files the same class files. This seems to have led to the problem described. I reinstalled the Simulator and took care that only the current cod files have been deployed in it, and now it works.

  • Flex Library Project - including the ActionScript code in an MXML file

    I am new to flex so I apologize if this is common knowledge.

    Breast Flash Builder 4.5, I created a project 'Flex '. I created a folder named "components" and created two files in this folder. ((1) Page.mxml, PageAs.as) 2. In the Page.mxml file, I included the PageAs.as file using the < fx:Script source = "PageAs.as" / > script tag. "

    I save and run it. Everything works very well. No errors.

    Now, I create a "Flex library project', I create a folder named"components"and create two files in this folder. ((1) Page.mxml, PageAs.as) 2. Before I have a chance to include the PageAs.as file in my Page.mxml file I get the following error.

    "A file in a source path must have a definition that is visible from the outside. If a definition in the file is intended to be visible from the outside, please put the definition in a package. »

    Here, I'm a bit confused. I have created two different projects but created two structures of identical files in each project. Why it worked very well in the 'Flex' project but not in the "Flex library project" and is it possible to fix the error?

    Page.MXML

    <?xml version="1.0" encoding="utf-8"?>
      
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
    
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx"
    
              <fx:Script source="Page.designer.as" />
     </s:Group> 
    

    PageAS.as

    import mx.events.*
     
    function unusedFunction():void
    {
          
    }
    
    
    
    

    Go to project-> Properties-> Flex Library Build Path-> Classes (tab)

    Uncheck all of the actionscript files that are not actually classes, but rather an external import in one class (your MXML).

    Also, for the record, it is common to use lowercase letters for files includes actionscript and no real class. Camel case file names should be reserved for the class files...

  • Why library projects?

    What is the advantage of a library project more having a source folder external that you share projects bewteen?

    If you have a library project it compiles a SWC rather than the swf. If other projects links to the CFC (instead of files, .as and .mxml 'raw' as in an external source folder) then development is faster because the library stuff are already compiled rather than to be recompiled every time you test/run/publish your main project

  • Flex Library Project does not update

    I created a flex library project, but when it is included in another project, I make some mistakes that make no sense.

    Picture 1.png

    The convertTime method so the mxml file present ControlPanel in the library project, but it's like Flex Builder cannot find them.  How can I fix?

    If you had the component in the library to the correct location, but you still have this error then you should check the library properties and see if this component is included in the source. Even if you the component folder, which is not necessary mean that it is included in the final result (it must be checked in the properties of the project where the source files are included).

  • Script for the library project files

    I want to create a library project that I can use with multiple Flex applications.  I'm moving the files from one of my apps in this new library.  However, one of the files that I brought to the wire is an actionscript file that I use in several files.  It's a bunch of generic utility methods that are nice to have.  I included it in the files like this:

    < mx:Script " source ="utilityScripts/UtilityScript.as """/ >

    Here is a small sample of code in this file:

    Import mx.rpc.events.FaultEvent;

    Import mx.controls.Alert;

    public function handleFault(event:FaultEvent):void {}

    Alert.show (event.toString (), 'Error');

    }

    In the original file, I said not yet as part of a package and it worked fine.  But now in the library project it gives me this error at the beginning:

    1114: the public attribute can only be used inside a package.

    So, if I give him a package name:

    package utilityScripts

    It then gives me a new error:

    1037: packages cannot be nested.

    How can I get this file in the library project?

    Yes, in your project library of all the files must have a package and class name,

    AFIK

Maybe you are looking for