Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Precompiled headers in Momentics: (6 Items)
   
Precompiled headers in Momentics  
I am having problems setting up precompiled headers in my project in Momentics.

Ex.
I have a file Precompiled.h which has lets say a few includes

#include  <math.h>
...
...

Then I have Precompiled.cpp which only has one line of code:

#include "Precompiled.h"



In each of my cpp files I have added as the first line:

#include "Precompiled.h"
.
.


In the IDE I added the following compiler option:

-x -cPrecompiled.h

None of my code in the cpps finds the math routines included in the precompiled headers.

Is there something I am missing?


Re: Precompiled headers in Momentics  
I got it to work from the command line using

qcc -lang-c++ -DVARIANT_a -DVARIANT_le -DVARIANT_v7 -x -c Precompiled.h -I%QNX_TARGET%/usr/include -I%QNX_TARGET%/usr/
include/cpp -I%QNX_TARGET%/usr/include/cpp/c

However I just want some advice on how to add a make target into my QNX C++ project within the IDE.
Re: Precompiled headers in Momentics  
If you using qnx project it should have a tab with extra compiler 
options, you can put

-x -c Precompiled.h

in there. Is it actually hardcoded path? It should probably be absolute path then.

On 30/03/2011 7:09 PM, Sean Taylor wrote:
> I got it to work from the command line using
>
> qcc -lang-c++ -DVARIANT_a -DVARIANT_le -DVARIANT_v7 -x -c Precompiled.h -I%QNX_TARGET%/usr/include -I%QNX_TARGET%/usr/
include/cpp -I%QNX_TARGET%/usr/include/cpp/c
>
> However I just want some advice on how to add a make target into my QNX C++ project within the IDE.
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post84437
>
Re: Precompiled headers in Momentics  
Right now my problem is that I have a static library which is successfully now building using precompiled header.


When I include this library from an application I am getting all sorts of errors about float variants of functions in <
math.h>

Ex.

make.exe[2]: Leaving directory `C:/depot/dev/graphics/qnx/autobahn_demo/arm/o-le-v7-g'
C:/depot/dev/graphics/qnx/autobahn/BoundingSphere.cpp:498: undefined reference to `sqrtf'
make.exe[1]: Leaving directory `C:/depot/dev/graphics/qnx/autobahn_demo/arm'
C:/depot/dev/graphics/qnx/autobahn/arm/a-le-v7-g\libautobahn_g.a(Quaternion.o): In function `Autobahn::Quaternion::
normalize(Autobahn::Quaternion*)':
C:/depot/dev/graphics/qnx/autobahn/Quaternion.cpp:182: undefined reference to `sqrtf'
C:/depot/dev/graphics/qnx/autobahn/arm/a-le-v7-g\libautobahn_g.a(Quaternion.o): In function `cosf':
C:/BBNDK100/target/qnx6/usr/include/math.h:655: undefined reference to `_FSin'
C:/depot/dev/graphics/qnx/autobahn/arm/a-le-v7-g\libautobahn_g.a(Quaternion.o): In function `sinf':
C:/BBNDK100/target/qnx6/usr/include/math.h:675: undefined reference to `_FSin'
C:/depot/dev/graphics/qnx/autobahn/arm/a-le-v7-g\libautobahn_g.a(Quaternion.o): In function `std::acos(float)':
C:/BBNDK100/target/qnx6/usr/include/math.h:699: undefined reference to `acosf'
cc: C:/BBNDK100/host/win32/x86/usr/bin/ntoarm-ld caught signal 1


Re: Precompiled headers in Momentics  
Do you link with math library?
-lm

On 30/03/2011 9:25 PM, Sean Taylor wrote:
> Right now my problem is that I have a static library which is successfully now building using precompiled header.
>
>
> When I include this library from an application I am getting all sorts of errors about float variants of functions in<
math.h>
>
> Ex.
>
> make.exe[2]: Leaving directory `C:/depot/dev/graphics/qnx/autobahn_demo/arm/o-le-v7-g'
> C:/depot/dev/graphics/qnx/autobahn/BoundingSphere.cpp:498: undefined reference to `sqrtf'
> make.exe[1]: Leaving directory `C:/depot/dev/graphics/qnx/autobahn_demo/arm'
> C:/depot/dev/graphics/qnx/autobahn/arm/a-le-v7-g\libautobahn_g.a(Quaternion.o): In function `Autobahn::Quaternion::
normalize(Autobahn::Quaternion*)':
> C:/depot/dev/graphics/qnx/autobahn/Quaternion.cpp:182: undefined reference to `sqrtf'
> C:/depot/dev/graphics/qnx/autobahn/arm/a-le-v7-g\libautobahn_g.a(Quaternion.o): In function `cosf':
> C:/BBNDK100/target/qnx6/usr/include/math.h:655: undefined reference to `_FSin'
> C:/depot/dev/graphics/qnx/autobahn/arm/a-le-v7-g\libautobahn_g.a(Quaternion.o): In function `sinf':
> C:/BBNDK100/target/qnx6/usr/include/math.h:675: undefined reference to `_FSin'
> C:/depot/dev/graphics/qnx/autobahn/arm/a-le-v7-g\libautobahn_g.a(Quaternion.o): In function `std::acos(float)':
> C:/BBNDK100/target/qnx6/usr/include/math.h:699: undefined reference to `acosf'
> cc: C:/BBNDK100/host/win32/x86/usr/bin/ntoarm-ld caught signal 1
>
>
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post84441
>
Re: Precompiled headers in Momentics  
Yeah, that fixed it. Wow, you really get used to no having to include that one in win32 programming. Dohh..