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
MrFlexile
Posts: 8
Registered: ‎09-26-2012
My Device: BlackBerry Playbook
My Carrier: MTS
Accepted Solution

Force Include problem

Hi,

 

I'm trying to port my existing game project to BlackBerry Playbook using NDK, but unfortunately there is an issue that I don't know how to fix.

 

My code base requires the force include option (header file that should be included in every other source file implicitly). I used the -include GCC command for Android OS and used precompiled header for iOS.

 

Here on BlackBerry I can't find precompiled header option so I tried to use -include command too. For that purpose I navigated to the project's Properties -> C/C++ Build -> Settings -> Tool Settings tab  and there under the QCC Compiler -> Extra Options -> Preprocessor Options (-Wp,) I added -include path.to.my.file option.

 

immediately after that I started to get the error message:

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

 

And sadly I have no idea how to fix this problem...

 

Did someone encounter the same one? Or if you know the valid approach to implement force includes, please, let me know!

 

Best regards,

Alexander.

Please use plain text.
New Contributor
MrFlexile
Posts: 8
Registered: ‎09-26-2012
My Device: BlackBerry Playbook
My Carrier: MTS

Re: Force Include problem

Hey guys!
The problem still exists. Does not anyone know how to solve it?
Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Force Include problem

Properties -> C/C++ Build -> Settings -> Tool Settings-> QCC Compiler ->

And there in Preprocessor section (-I [it is capital Ai not El]) specify list of folders you want the compiler to search for include files in.

Please use plain text.
New Contributor
MrFlexile
Posts: 8
Registered: ‎09-26-2012
My Device: BlackBerry Playbook
My Carrier: MTS

Re: Force Include problem

I'm not sure if you correctly understand what i need...
I don't have problems with search path for include files.

I need the force include option. When you can specify one or multiple specific header files which will be included in every other source file implicitly and automatically while compiling the project.
Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Force Include problem

Ok, sorry... misunderstood your requirements.

The easiest way is just to add one file to your sources

File myincludes.h

#ifndef MYINCLUDES_H

#define MYINCLUDES_H

#include "file1.h"

#include "file2.h"

... etc...

#endif

Then include myincludes.h wherever needed in your source files.

Please use plain text.
New Contributor
MrFlexile
Posts: 8
Registered: ‎09-26-2012
My Device: BlackBerry Playbook
My Carrier: MTS

Re: Force Include problem

Yeah, I know it :smileyhappy:

But I have a fairly large code base, and it will be difficult to make it manually. iOS, Android and Win32 have the ability to use forceinclude somehow...

On the android platform I use the gcc "-include" option, iOS version is using precompiled header which can be included automatically. Visual studio has a build-in option for the force include... Here, i can't find anything that works yet.
Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Force Include problem

Then try putting your -include xxx in Properties -> C/C++ Build -> Settings -> Tool Settings -> QCC Compiler -> Extra Options -> QCC Options

Please use plain text.
New Contributor
MrFlexile
Posts: 8
Registered: ‎09-26-2012
My Device: BlackBerry Playbook
My Carrier: MTS

Re: Force Include problem

It seems that you don't even read what I write :smileyhappy:

I said about the problem with -include option in the first post here :smileyhappy:
Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Force Include problem

You put it in wrong place in the first post.

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

Re: Force Include problem

... or just ignore me.

Please use plain text.