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
New Contributor
Posts: 4
Registered: ‎02-08-2013
My Device: Blackberry 10 and playBook
My Carrier: Simulator Blackberry 10 and playBook
Accepted Solution

Code not compile with "<bb/AbstractBpsEventHandler>"

Hey,

 

I'm new in Blackberry and I'm trying to do an App which use internet connection. For that i'm using this tuto (link). 

 

This tuto explaine you how get the connection status (if it's Connected or not and it's Wifi, 3G...) But when the class StatuesEvent extend "public bb::AbstractBpsEventHandler"

 

I can't compile and I got that error:

 

cc: /Applications/BlackBerry/host_10_1_0_212/darwin/x86/usr/bin/ntox86-ld error 1

make[2]: *** [o-g/ShareTaxie] Error 1

make[1]: *** [debug] Error 2

make: *** [Simulator-Debug] Error 2

 

PLS, Someone can explaine to me why ? I don't understand at all....

 

Here is the class 'StatusEvent.hpp'

 

#ifndef STATUSEVENT_HPP_
#define STATUSEVENT_HPP_
 
#include <QObject>
#include <QString>
#include <bb/AbstractBpsEventHandler>
 
class StatusEvent: public QObject, public bb::AbstractBpsEventHandler
{
    Q_OBJECT
 
public:
    StatusEvent();
    virtual ~StatusEvent();
    virtual void event(bps_event_t *event);
 
signals:
    void networkStatusUpdated(bool status, QString type);
};
 
#endif /* STATUSEVENT_HPP_ */

 

Here the full console:

**** Build of configuration Simulator-Debug for project ProjectTest ****

 

make -j3 Simulator-Debug 

make -C .//translations -f Makefile update

make[1]: Entering directory `/Users/workspace/ProjectTest/translations'

/Applications/BlackBerry/host_10_1_0_212/darwin/x86/usr/bin/lupdate ProjectTest.pro

Updating 'ProjectTest.ts'...

    Found 3 source text(s) (0 new and 3 already existing)

make[1]: Leaving directory `/Users/workspace/ProjectTest/translations'

make -C .//translations -f Makefile release

make[1]: Entering directory `/Users/workspace/ProjectTest/translations'

/Applications/BlackBerry/host_10_1_0_212/darwin/x86/usr/bin/lrelease ProjectTest.pro

Updating '/Users/workspace/ProjectTest/translations/ProjectTest.qm'...

    Generated 0 translation(s) (0 finished and 0 unfinished)

    Ignored 3 untranslated source text(s)

make[1]: Leaving directory `/Users/workspace/ProjectTest/translations'

make -C ./x86 -f Makefile debug

make[1]: Entering directory `/Users/workspace/ProjectTest/x86'

make -f Makefile.Debug

make[2]: Entering directory `/Users/workspace/ProjectTest/x86'

qcc -Vgcc_ntox86 -c -Wc,-include -Wc,o-g/.obj/ProjectTest -Wno-psabi -lang-c++ -fstack-protector -fstack-protector-all -g -Wno-psabi -Wall -W -D_REENTRANT -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -DQT_DECLARATIVE_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-x86-qcc -I../../ProjectTest -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src/ItineraireCustomControl/Model -I../src/Tools/Connector -I../src/ItineraireCustomControl -I../src/Global -I../src -Io-g/.moc -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -o o-g/.obj/StatusEvent.o ../src/Tools/Connector/StatusEvent.cpp

../src/Tools/Connector/StatusEvent.cpp: In member function 'virtual void StatusEvent::event(bps_event_t*)':

/Applications/BlackBerry/host_10_1_0_212/darwin/x86/usr/bin/moc -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -DQT_DECLARATIVE_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-x86-qcc -I../../ProjectTest -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src/ItineraireCustomControl/Model -I../src/Tools/Connector -I../src/ItineraireCustomControl -I../src/Global -I../src -Io-g/.moc -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -D__QNXNTO__ ../src/Tools/Connector/StatusEvent.hpp -o o-g/.moc/moc_StatusEvent.cpp

../src/Tools/Connector/StatusEvent.cpp:44:24: warning: enumeration value 'NETSTATUS_INTERFACE_TYPE_WIRED' not handled in switch [-Wswitch]

qcc -Vgcc_ntox86 -c -Wc,-include -Wc,o-g/.obj/ProjectTest -Wno-psabi -lang-c++ -fstack-protector -fstack-protector-all -g -Wno-psabi -Wall -W -D_REENTRANT -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -DQT_DECLARATIVE_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-x86-qcc -I../../ProjectTest -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src/ItineraireCustomControl/Model -I../src/Tools/Connector -I../src/ItineraireCustomControl -I../src/Global -I../src -Io-g/.moc -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include -I/Applications/BlackBerry/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -o o-g/.obj/moc_StatusEvent.o o-g/.moc/moc_StatusEvent.cpp

../src/Tools/Connector/StatusEvent.cpp:44:24: warning: enumeration value 'NETSTATUS_INTERFACE_TYPE_USB' not handled in switch [-Wswitch]

qcc -Vgcc_ntox86 -lang-c++ -Wl,-rpath-link,/Applications/BlackBerry/target_10_1_0_1483/qnx6/x86/lib -Wl,-rpath-link,/Applications/BlackBerry/target_10_1_0_1483/qnx6/x86/usr/lib -Wl,-rpath-link,/Applications/BlackBerry/target_10_1_0_1483/qnx6/x86/usr/lib/qt4/lib -o o-g/ProjectTest o-g/.obj/ItineraireItem.o o-g/.obj/ItineraireItemFactory.o o-g/.obj/ModelItineraire.o o-g/.obj/StatusEvent.o o-g/.obj/applicationui.o o-g/.obj/main.o o-g/.obj/moc_ItineraireItem.o o-g/.obj/moc_ItineraireItemFactory.o o-g/.obj/moc_StatusEvent.o o-g/.obj/moc_applicationui.o    -L/Applications/BlackBerry/target_10_1_0_1483/qnx6/x86/lib -L/Applications/BlackBerry/target_10_1_0_1483/qnx6/x86/usr/lib -L/Applications/BlackBerry/target_10_1_0_1483/qnx6/x86/usr/lib/qt4/lib -L/Applications/BlackBerry/target_10_1_0_1483/qnx6//usr/lib/qt4/lib -lbbcascades -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lsqlite3 -lz -lQtXmlPatterns -lQtGui -lQtNetwork -lsocket -lQtCore -lm -lbps 

../src/Tools/Connector/StatusEvent.cpp:44:24: warning: enumeration value 'NETSTATUS_INTERFACE_TYPE_VPN' not handled in switch [-Wswitch]

make[2]: Leaving directory `/Users/workspace/ProjectTest/x86'

../src/Tools/Connector/StatusEvent.cpp:44:24: warning: enumeration value 'NETSTATUS_INTERFACE_TYPE_BB' not handled in switch [-Wswitch]

make[1]: Leaving directory `/Users/workspace/ProjectTest/x86'

/Applications/BlackBerry/host_10_1_0_212/darwin/x86/usr/bin/ntox86-ld: o-g/.obj/moc_StatusEvent.o: undefined reference to symbol '_ZTIN2bb23AbstractBpsEventHandlerE'

/Applications/BlackBerry/host_10_1_0_212/darwin/x86/usr/bin/ntox86-ld: note: '_ZTIN2bb23AbstractBpsEventHandlerE' is defined in DSO /Applications/BlackBerry/target_10_1_0_1483/qnx6/x86/usr/lib/libbb.so.1 so try adding it to the linker command line

/Applications/BlackBerry/target_10_1_0_1483/qnx6/x86/usr/lib/libbb.so.1: could not read symbols: Invalid operation

cc: /Applications/BlackBerry/host_10_1_0_212/darwin/x86/usr/bin/ntox86-ld error 1

make[2]: *** [o-g/ProjectTest] Error 1

make[1]: *** [debug] Error 2

make: *** [Simulator-Debug] Error 2

 

**** Build Finished ****

 

 

 

Developer
Posts: 196
Registered: ‎03-04-2013
My Device: BB Z10
My Carrier: Rogers

Re: Code not compile with "<bb/AbstractBpsEventHandler>"

In your application's .PRO file, did you add in this line?

 

    LIBS += -lbb

 

New Contributor
Posts: 4
Registered: ‎02-08-2013
My Device: Blackberry 10 and playBook
My Carrier: Simulator Blackberry 10 and playBook

Re: Code not compile with "<bb/AbstractBpsEventHandler>"

Hey Jalue,

 

Thanks... Smiley Happy the project compile Smiley Happy... How did you know ? Just to know "lbb" mean "Library BlackBerry" right ?

 

Thanks again 

Douvi

Developer
Posts: 196
Registered: ‎03-04-2013
My Device: BB Z10
My Carrier: Rogers

Re: Code not compile with "<bb/AbstractBpsEventHandler>"

Well, a few things would tell you what might be wrong. The errors you may get when you try to compile something and as an example, the following line would be a huge clue:

 

/Applications/BlackBerry/host_10_1_0_212/darwin/x86/usr/bin/ntox86-ld: note: '_ZTIN2bb23AbstractBpsEventHandlerE' is defined in DSO /Applications/BlackBerry/target_10_1_0_1483/qnx6/x86/usr/lib/libbb.so.1 so try adding it to the linker command line

 

The other would be the documentation for AbstractBpsEventHandler, which actually tells you that you need the "-lbb" addition...

https://developer.blackberry.com/cascades/reference/bb__abstractbpseventhandler.html

 

When all else fails, read the documentation.  Smiley Happy