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
Regular Contributor
leppa
Posts: 70
Registered: ‎02-01-2013
My Device: BlackBerry Z10 Limited Edition

Re: #include <QtNetwork> fails

[ Edited ]

If you create a new project from the template - can you compile it without making any changes or you get same errors?

 

If you can't, try reinstalling the SDK - I once broke mine somehow and only complete reinstall made it work again.

--
With best regards,
Oleksii Serdiuk
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700

Re: #include <QtNetwork> fails

Nothing wrong wit IDE  another Cascade sample and a native sample works fine, both compiling and running on simulator. I noticed that the Cascade sample had a lot more includes so in some way my project was corrupt. So I put up a new one with all corrections made.  It compiled better after I made another correction in the code. Maybe not needed but nicer. Added "default" to a case switch.

 

No binaries.  Error messages:

 

C:\Users\Ingvar\ndk-10.1.0-workspace\checkCompile\x86/o-g/.moc/moc_applicationui.cpp:66: multiple definition of `ApplicationUI::qt_metacast(char const*)'
o-g/.obj/moc_application.o:C:\Users\Ingvar\ndk-10.1.0-workspace\checkCompile\x86/o-g/.moc/moc_application.cpp:87: first defined here
o-g/.obj/moc_applicationui.o: In function `ApplicationUI::qt_metacall(QMetaObject::Call, int, void**)':
C:\Users\Ingvar\ndk-10.1.0-workspace\checkCompile\x86/o-g/.moc/moc_applicationui.cpp:74: multiple definition of `ApplicationUI::qt_metacall(QMetaObject::Call, int, void**)'
o-g/.obj/moc_application.o:C:\Users\Ingvar\ndk-10.1.0-workspace\checkCompile\x86/o-g/.moc/moc_application.cpp:95: first defined here
C:\bbndk\host_10_1_0_212\win32\x86\usr\bin\ntox86-ld: o-g/.obj/moc_StatusEvent.o: undefined reference to symbol '_ZTIN2bb23AbstractBpsEventHandlerE'
C:\bbndk\host_10_1_0_212\win32\x86\usr\bin\ntox86-ld: note: '_ZTIN2bb23AbstractBpsEventHandlerE' is defined in DSO C:/bbndk/target_10_1_0_1483/qnx6/x86/usr/lib/libbb.so.1 so try adding it to the linker command line
C:/bbndk/target_10_1_0_1483/qnx6/x86/usr/lib/libbb.so.1: could not read symbols: Invalid operation
cc: C:/bbndk/host_10_1_0_212/win32/x86/usr/bin/ntox86-ld caught signal 1
make[2]: Leaving directory `C:/Users/Ingvar/ndk-10.1.0-workspace/checkCompile/x86'
make[2]: *** [o-g/checkCompile] Error 1
make[1]: *** [debug] Error 2
make[1]: Leaving directory `C:/Users/Ingvar/ndk-10.1.0-workspace/checkCompile/x86'
make: *** [Simulator-Debug] Error 2

 

 

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: #include <QtNetwork> fails

It seems that ApplicationUI class is defined both in applicationui.cpp and application.cpp, so it produces duplicate symbols when linking.

 

 

C:/bbndk/target_10_1_0_1483/qnx6/x86/usr/lib/libbb.so.1 so try adding it to the linker command line

This error can be fixed by adding LIBS += -lbb to .pro file

 

It's better to start from a new project template generated by wizard in IDE then move source code files from samples to it. Samples can contain older project templates not reflecting the latest changes in SDK.


Andrey Fidrya, @zmeyc on twitter
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700

Re: #include <QtNetwork> fails

Thanks. Will check that out.

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700

Re: #include <QtNetwork> fails

Last(?) Error

 

o-g/.obj/applicationui.o o-g/.obj/main.o o-g/.obj/moc_StatusEvent.o o-g/.obj/moc_applicationui.o    -LC:/bbndk/target_10_1_0_1483/qnx6/x86/lib -LC:/bbndk/target_10_1_0_1483/qnx6/x86/usr/lib -LC:/bbndk/target_10_1_0_1483/qnx6/x86/usr/lib/qt4/lib -LC:/bbndk/target_10_1_0_1483/qnx6//usr/lib/qt4/lib lbb -lbbcascades -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lsqlite3 -lz -lQtXmlPatterns -lQtGui -lQtNetwork -lsocket -lQtCore -lm -lbps
C:\bbndk\host_10_1_0_212\win32\x86\usr\bin\ntox86-ld: cannot find lbb: No such file or directory
cc: C:/bbndk/host_10_1_0_212/win32/x86/usr/bin/ntox86-ld caught signal 1
make[2]: *** [o-g/TestHttp2] Error 1
make[2]: Leaving directory `C:/Users/Ingvar/ndk-10.1.0-workspace/TestHttp2/x86'
make[1]: *** [debug] Error 2
make[1]: Leaving directory `C:/Users/Ingvar/ndk-10.1.0-workspace/TestHttp2/x86'
make: *** [Simulator-Debug] Error 2

**** Build Finished ****

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Regular Contributor
leppa
Posts: 70
Registered: ‎02-01-2013
My Device: BlackBerry Z10 Limited Edition

Re: #include <QtNetwork> fails

It seems that instead of

LIBS += -lbb

 you have

LIBS += lbb

 in your .pro file (note the missing minus).

--
With best regards,
Oleksii Serdiuk
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700

Re: #include <QtNetwork> fails

leppa. you are a star. I will put the solution to you even though others have been helpful.

 

 The sample works now

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-