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
Contributor
idom
Posts: 16
Registered: ‎06-17-2012
My Carrier: MTS
Accepted Solution

Problem with compilation in QNX Momentics IDE

Hello! I develope small Qt-based application for BlackBerry Playbook. 

When I attempt build my app in Simulator-Debug mode, NDK reports about error:

cc: Can't specify -P, -C, -E, -c or -S with -o and have multiple files

 

How can I fix this error? 

Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Carrier: N/A

Re: Problem with compilation in QNX Momentics IDE

Hey there,

 

Welcome to the forums!

 

First, can you verify that you are able to compile and run sample applications?

Sample apps for Playbook NDK 2.0: https://developer.blackberry.com/native/

 

Martin

 

Please use plain text.
Contributor
idom
Posts: 16
Registered: ‎06-17-2012
My Carrier: MTS

Re: Problem with compilation in QNX Momentics IDE

I compiled and started these applications earlier and didn't have similar problems. 

But, what you can tall about this error, how can I fix it? 

Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Carrier: N/A

Re: Problem with compilation in QNX Momentics IDE

To answer this I need more context. Are you attempting to MOC Q_OBJECT files manually?
Can you show me your complete error log?

Martin

Please use plain text.
Contributor
idom
Posts: 16
Registered: ‎06-17-2012
My Carrier: MTS

Re: Problem with compilation in QNX Momentics IDE

Hello, Martin.

>>To answer this I need more context. Are you attempting to MOC Q_OBJECT files manually?

No, I use moc files and ui haders, which created by QtCreator.

 

>>Can you show me your complete error log?

Yes.

 

**** Internal Builder is used for build               ****
qcc -o src/oauth.o ../src/oauth.cpp -V4.4.2,gcc_ntox86_cpp -w1 -I/home/idom/bbndk-2.0.1/target/qnx6/usr/include/freetype2 -I/home/idom/bbndk-2.0.1/target/qnx6/../target-override/usr/include -I/home/idom/bbndk-2.0.1/target/qnx6/../target-override/usr/include/qt4 -D_FORTIFY_SOURCE=2 -DQT_BOOTSTRAPPED -DQ_WS_QPA -DQ_MOC_OUTPUT_REVISION = 63 -c -O0 -g -fstack-protector-all
cc: Can't specify -P, -C, -E, -c or -S with -o and have multiple files
Build error occurred, build is stopped
Time consumed: 321  ms.  

 




Please use plain text.
Developer
BGmot
Posts: 1,061
Registered: ‎11-24-2011
My Carrier: x

Re: Problem with compilation in QNX Momentics IDE

Don't you have a typo:

-DQ_MOC_OUTPUT_REVISION = 63

shouldn't it be:

-DQ_MOC_OUTPUT_REVISION=63
Please use plain text.
Contributor
idom
Posts: 16
Registered: ‎06-17-2012
My Carrier: MTS

Re: Problem with compilation in QNX Momentics IDE

Big Thx! I remove spaces from this constant and in works.

But I have new problem.

I use Qt-JSON and any functions of this instrument declared with multiply defenition. When I build my project in QtCreator all works, but Momentics report about error.

example of function's signature:

 

static QVariant parse(const QString &json);
static QVariant parse(const QString &json, bool &success);

Momentics report:

../src/json.cpp:70: multiple definition of `QtJson::Json::parse(QString const&)'
../src/qt-json/json.cpp:70: first defined here
src/json.o: In function `QtJson::Json::parse(QString const&, bool&)':
../src/json.cpp:79: multiple definition of `QtJson::Json::parse(QString const&, bool&)'
../src/qt-json/json.cpp:79: first defined here

 

 

 

 

 

Please use plain text.
Developer
BGmot
Posts: 1,061
Registered: ‎11-24-2011
My Carrier: x

Re: Problem with compilation in QNX Momentics IDE

It's what it says - you have two function declarations.

Are you sure you want both ../src/json.cpp and ../src/qt-json/json.cpp included in your project?

Please use plain text.
Contributor
idom
Posts: 16
Registered: ‎06-17-2012
My Carrier: MTS

Re: Problem with compilation in QNX Momentics IDE

Sorry for my carelessness, i forgot to look at paths.:Oops:

Please use plain text.