01-24-2013 12:00 PM - edited 01-24-2013 12:06 PM
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(th is);
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
Solved! Go to Solution.
01-24-2013 02:50 PM
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
01-25-2013 08:36 AM - edited 01-25-2013 08:39 AM
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
01-25-2013 11:06 AM
These things are usually mentioned in API docs https://developer.blackberry.com/cascades/referenc
01-25-2013 11:51 AM
Thank you for your helpful reply. I got it.