BlackBerry 10: GNU STL

I am trying to create a BB10 cascade project using the Momentics IDE version 2.0, and I need a project to use the GNU standard library instead of Dinkumware (because I have external libraries compiled from arm-unknown-nto-qnx8.0.0eabi-g++that only support gnu std).

In the IDE, I changed Project Properties-> C / C ++ Build / Settings / Runtime to β€œC ++ GNU with Exceptions”. However, when I run a simple project with a static library (.a file) created by me (only with a header containing the constructor, object std::string, setter and getter (for the object) and the corresponding cpp file) I get a segmentation error when I do this:

testnamespace::testclass *object = new testnamespace::testclass();

std::string test = "Hello";
object->setText(test);

delete object;

I think this error occurs because the library was compiled with gnu std and the project was compiled with Dinkumware.

I checked the inclusion paths and I found out that

C:\bbndk\target_10_1_0_428\qnx6\usr\include 

contained before

C:\bbndk\target_10_1_0_428\qnx6\usr\include\c++\4.6.3

Also, the command used by makefile to compile the cpp files in the project qcc -Vgcc_ntoarmv7leinstead qcc -V4.6.3,gcc_ntoarmv7le_gpp(support flag for gnu stl).

Am I doing something wrong? Some configuration missing?

I really need to use GNU STD instead of Dinkumware in my BlackBerry project, but I cannot figure out how to do this.

EDIT:

I made some changes to my project and fixed some problems.

I added this to my .pro file

QMAKE_CXX = qcc -V4.6.3,gcc_ntoarmv7le_gpp
QMAKE_CC = qcc -V4.6.3,gcc_ntoarmv7le
QMAKE_LINK = qcc -V4.6.3,gcc_ntoarmv7le_gpp
QMAKE_AS = qcc -V4.6.3,gcc_ntoarmv7le_gpp

LIBS += -lc -lm -lcpp -lstdc++ -Bstatic ../libs/libteste.a -Bdynamic

(The LIBS team was already there, but I decided to put it here so you can understand how I link libraries).

Now I have the following code:

testenamespace::TesteClass *temp = new testenamespace::TesteClass() ;

std::string teste = "Hello";

temp->setTesteString(teste);

QString qsr = QString::fromStdString(temp->getTesteString());


qDebug ("String in the object: "+qsr.toLatin1());

delete temp;

, delete temp;, :

Qml . ! : , 1173778674 (test_bb10) SIGSEGV code = 2 fltno = 11 ip = 0150ed7c (/usr/lib/ldqnx.so.2@_list_release+0x3c) mapaddr = 0002ed7c. = 78362e2b

Qml . ! : , malloc, :../../dlist.c: 1096 **

, new delete, , , , .

.

+4
1

, Ubuntu. Momentics Windows GNU ++ .

+2

All Articles