Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Using C++ tr1 extensions: (5 Items)
   
Using C++ tr1 extensions  
I am interested in using the c++ tr1 extensions.

I am having problems configuring a QNX C++ project to use these extensions.

tr1 is found in $(QNX_TARGET)/usr/include/c++/4.3.3

So...I add this path to the Include path, but the compiler complains:


bits/c++allocator.h: No such file or directory	allocator.h	

as well as other files in bits/ it can't find.

The specific files bits/xxx.h are in a target specific subdirectory. I surmise I need to add some sort of target 
specific info to my project, but I don't know what that is.

I am using Momentics 4.6.1 and, of course, qcc 4.3.3. Target is only x86 at this time.

Thanks.

Test Program:

#include <cstdlib>
#include <iostream>
#include <tr1/tuple>

int main(int argc, char *argv[]) {
	std::cout << "Test using TR1 extensions" << std::endl;
	return EXIT_SUCCESS;
}
Re: Using C++ tr1 extensions  
Hi, Keith,

If your QNX C++ project targets only one platform (e.g., x86), then you
can just add

  $(QNX_TARGET)/usr/include/c++/4.3.3/i386-pc-unknown-nto-qnx6.4.0

to your "extra include paths" property in the project settings.

When you do add other targets to your project, then you will need to use
the "Advanced >>" button in the Project Properties dialog to set a
different include path per platform.  In the platform picker at the left
side of the dialog choose a target platform and set the appropriate
include path like the one above.  Make sure that the "All" selection
doesn't have any target-specific include path.

HTH,

Christian


  
On Sun, 2010-01-17 at 12:23 -0500, Keith Smith wrote:

> I am interested in using the c++ tr1 extensions.
> 
> I am having problems configuring a QNX C++ project to use these extensions.
> 
> tr1 is found in $(QNX_TARGET)/usr/include/c++/4.3.3
> 
> So...I add this path to the Include path, but the compiler complains:
> 
> 
> bits/c++allocator.h: No such file or directory	allocator.h	
> 
> as well as other files in bits/ it can't find.
> 
> The specific files bits/xxx.h are in a target specific subdirectory. I surmise I need to add some sort of target 
specific info to my project, but I don't know what that is.
> 
> I am using Momentics 4.6.1 and, of course, qcc 4.3.3. Target is only x86 at this time.
> 
> Thanks.
> 
> Test Program:
> 
> #include <cstdlib>
> #include <iostream>
> #include <tr1/tuple>
> 
> int main(int argc, char *argv[]) {
> 	std::cout << "Test using TR1 extensions" << std::endl;
> 	return EXIT_SUCCESS;
> }
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post45365


Re: Using C++ tr1 extensions  
Christian Damus wrote:
> Hi, Keith,
> 
> If your QNX C++ project targets only one platform (e.g., x86), then you
> can just add
> 
>   $(QNX_TARGET)/usr/include/c++/4.3.3/i386-pc-unknown-nto-qnx6.4.0
> 
> to your "extra include paths" property in the project settings.
> 
> When you do add other targets to your project, then you will need to use
> the "Advanced >>" button in the Project Properties dialog to set a
> different include path per platform.  In the platform picker at the left
> side of the dialog choose a target platform and set the appropriate
> include path like the one above.  Make sure that the "All" selection
> doesn't have any target-specific include path.

The headers are not found because by default qcc uses the Dinkumware C++ 
library which does not have tr1 support. If you switch the C++ library 
variant to GNU libstdc++ (qcc's -Y_gpp option) then qcc will add the 
include path to $(QNX_TARGET)/usr/include/c++/4.3.3/<canonical name>. 
Specifying the -Y_gpp option will link the binary against libstdc++ 
instead of libcpp.

The way to use the GNU libstdc++-v3 in the IDE is to go to the Linker 
tab and select in the "Link against CPP Library" select "GNU with 
Exceptions".

Regards,

Ryan Mansfield

> On Sun, 2010-01-17 at 12:23 -0500, Keith Smith wrote:
> 
>> I am interested in using the c++ tr1 extensions.
>>
>> I am having problems configuring a QNX C++ project to use these extensions.
>>
>> tr1 is found in $(QNX_TARGET)/usr/include/c++/4.3.3
>>
>> So...I add this path to the Include path, but the compiler complains:
>>
>>
>> bits/c++allocator.h: No such file or directory	allocator.h	
>>
>> as well as other files in bits/ it can't find.
>>
>> The specific files bits/xxx.h are in a target specific subdirectory. I surmise I need to add some sort of target 
specific info to my project, but I don't know what that is.
>>
>> I am using Momentics 4.6.1 and, of course, qcc 4.3.3. Target is only x86 at this time.
>>
>> Thanks.
>>
>> Test Program:
>>
>> #include <cstdlib>
>> #include <iostream>
>> #include <tr1/tuple>
>>
>> int main(int argc, char *argv[]) {
>> 	std::cout << "Test using TR1 extensions" << std::endl;
>> 	return EXIT_SUCCESS;
>> }
>>
>>
>>
>>
>> _______________________________________________
>>
>> General
>> http://community.qnx.com/sf/go/post45365
> 
> 
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post45407
> 
Re: Using C++ tr1 extensions  
Oo!  Thanks, Ryan.

Definitely a superior answer.  :-)

cW

On Mon, 2010-01-18 at 12:38 -0500, Ryan Mansfield wrote:

> Christian Damus wrote:
> > Hi, Keith,
> > 
> > If your QNX C++ project targets only one platform (e.g., x86), then you
> > can just add
> > 
> >   $(QNX_TARGET)/usr/include/c++/4.3.3/i386-pc-unknown-nto-qnx6.4.0
> > 
> > to your "extra include paths" property in the project settings.
> > 
> > When you do add other targets to your project, then you will need to use
> > the "Advanced >>" button in the Project Properties dialog to set a
> > different include path per platform.  In the platform picker at the left
> > side of the dialog choose a target platform and set the appropriate
> > include path like the one above.  Make sure that the "All" selection
> > doesn't have any target-specific include path.
> 
> The headers are not found because by default qcc uses the Dinkumware C++ 
> library which does not have tr1 support. If you switch the C++ library 
> variant to GNU libstdc++ (qcc's -Y_gpp option) then qcc will add the 
> include path to $(QNX_TARGET)/usr/include/c++/4.3.3/<canonical name>. 
> Specifying the -Y_gpp option will link the binary against libstdc++ 
> instead of libcpp.
> 
> The way to use the GNU libstdc++-v3 in the IDE is to go to the Linker 
> tab and select in the "Link against CPP Library" select "GNU with 
> Exceptions".
> 
> Regards,
> 
> Ryan Mansfield
> 
> > On Sun, 2010-01-17 at 12:23 -0500, Keith Smith wrote:


--------8<--------


Re: Using C++ tr1 extensions  
Thanks. That fixed my tr1 problem.