Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All
Accepted Solution

Build failed if create a InvokeManager

[ Edited ]

In the class construction, if I new create the InvokeManager, the building process will be failed. It only show a red cross at the project.  There is not any error hint by which I can know what's wrong.

 

If I delete the line of source ", m_invokeManager(new InvokeManager(this))" in Gateway.cpp, everything is OK.

 

Do I need to set up other libraries in the project or is it related with permission?

 

Thank you

 

The source code is as below:

Gateway.hpp

// Default empty project template
#ifndef Gateway_HPP_
#define Gateway_HPP_

#include <QObject>
#include <bb/system/InvokeManager>

namespace bb { namespace cascades { class Application; }}

/*!
 * @brief Application pane object
 *
 *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
 */
class Gateway : public QObject
{
    Q_OBJECT
public:
    //Gateway(bb::cascades::Application *app);
    Gateway(QObject *parent = 0);
    virtual ~Gateway() {}
private:
    // The central object to manage invocations
    bb::system::InvokeManager* m_invokeManager;
};


#endif /* Gateway_HPP_ */

 Gateway.cpp

// Default empty project template
#include "Gateway.hpp"

#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
#include <bb/cascades/AbstractPane>
#include <bb/cascades/NavigationPane>

using namespace bb::cascades;
using namespace bb::system;

/*Gateway::Gateway(bb::cascades::Application *app)
: QObject(app)*/
Gateway::Gateway(QObject *parent)
    : QObject(parent)
    , m_invokeManager(new InvokeManager(this))
{

    // create scene document from main.qml asset
    // set parent to created document to ensure it exists for the whole application lifetime
    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);

    if (!qml->hasErrors()) {

		// The application NavigationPane is created from QML.
		NavigationPane *navPane = qml->createRootObject<NavigationPane>();

		if (navPane) {
			qml->setContextProperty("_navPane", navPane);

			// Set the main scene for the application to the NavigationPane.
			//app->setScene(navPane);
			Application::instance()->setScene(navPane);
		}
	}
}

 Console Log

C:\bbndk\host_10_0_9_404\win32\x86\usr\bin\ntoarm-ld: note: '_ZN2bb6system13InvokeManagerC1EP7QObject' is defined in DSO C:/bbndk/target_10_0_9_1673/qnx6/armle-v7/usr/lib/libbbsystem.so.1 so try adding it to the linker command line
make[1]: Leaving directory `C:/bbndk/workspace/Gateway/arm'
C:/bbndk/target_10_0_9_1673/qnx6/armle-v7/usr/lib/libbbsystem.so.1: could not read symbols: Invalid operation
cc: C:/bbndk/host_10_0_9_404/win32/x86/usr/bin/ntoarm-ld caught signal 1
make[2]: *** [o.le-v7-g/Gateway] Error 1
make[1]: *** [debug] Error 2
make: *** [Device-Debug] Error 2

 




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
lewellyn
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: Build failed if create a InvokeManager

As the start of your errors state, you need to link against libbbsystem.so.1.

 

This is done by adding the following line to your .pro file in Momentics:

 

LIBS += -lbbsystem

 



Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! :smileyvery-happy:
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: Build failed if create a InvokeManager

[ Edited ]

Thank you for your solution. It works finally by adding the library of lbbsystem.

 

By the way, do you know which official document mentions this way by adding library to resolve this kind of build error?

Is there a list of library in the official document by that I can know which library should be added into the project?

 

Just wondering how can I fix the other issues like this one by myself in future? I am looking forward for your suggestion.

 

Jarvis




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Build failed if create a InvokeManager

Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: Build failed if create a InvokeManager

Thank you for your helpful reply. I got it.




p(^_^)q
Good good study, day day up
Please use plain text.