Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Cant include in a Cpp project: (9 Items)
   
Cant include in a Cpp project  
Hello, my name is Phil, i am from Germany, so sorry for my terrible english. ;)

my problem is, that i cant include a file in my qnx momentic 4.7.0 on windows7.
i can include my own header files, but not the standard one. 
as example, the iostream and what i get, after the building
"iostream: No such file or directory"

please, can someone help me?



Re: Cant include in a Cpp project  
Does your source file have a C++ extension? e.g. .cc or .cpp or .cxx. If your source file has a C extension, the 
compiler will compile it as C and the default C++ search paths will not be included and searched. If this is the case, 
change the file extension or add -lang-c++ or -x c++ to compile the file as C++.

Regards,

Ryan Mansfield
Re: Cant include in a Cpp project  
yes. it is a .cpp source file (and a cpp project).
i get the same include problem with a normal c project.
Re: Cant include in a Cpp project  
You missing some-how all standard include paths. Is you QNX_TARGET env variable set properly?

On 09/22/2011 08:12 AM, Philip Bilinski wrote:
> yes. it is a .cpp source file (and a cpp project).
> i get the same include problem with a normal c project.
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post89017
> 
Re: Cant include in a Cpp project  
Do i need to configurate the "QNX_TARGET env variable", even if i only work with a normal c++ project and not an qnx c++
 project?
if the answer is yes, how can i change it? 

(Thank you guys for your help)
Re: Cant include in a Cpp project  
Hi, Philip,

If the project is a normal C++ project using the QCC Toolchain, then the QNX_TARGET environment variable will be defined
 for it automatically based on the SDP selected in the QNX preference page.

HTH,

Christian


On 2011-09-22, at 1:36 PM, Philip Bilinski wrote:

> Do i need to configurate the "QNX_TARGET env variable", even if i only work with a normal c++ project and not an qnx c
++ project?
> if the answer is yes, how can i change it? 
> 
> (Thank you guys for your help)
Re: Cant include in a Cpp project  
as example:
new poject...-> c++project -> executable hello worldc++ project with qnx qcc toolchains

after that, i see that the include<iostream> (in the source file) is yellow
Unresolved inclusion: <iostream>

after the building, i get the error.
Re: Cant include in a Cpp project  
So error in the build console? Can you cut & paste it?

On 09/22/2011 02:00 PM, Philip Bilinski wrote:
> as example:
> new poject...-> c++project -> executable hello worldc++ project with qnx qcc toolchains
> 
> after that, i see that the include<iostream> (in the source file) is yellow
> Unresolved inclusion: <iostream>
> 
> after the building, i get the error.
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post89033
> 
Re: Cant include in a Cpp project  
console after the building:

**** Rebuild of configuration Debug for project Test4 ****

**** Internal Builder is used for build               ****
qcc -o src\Test4.o ..\src\Test4.cpp -V4.4.2,gcc_ntox86_cpp -w1 -c -g
..\src\Test4.cpp:9:20: error: iostream: No such file or directory
..\src\Test4.cpp: In function 'int main()':
..\src\Test4.cpp:13: error: 'cout' was not declared in this scope
..\src\Test4.cpp:13: error: 'endl' was not declared in this scope
cc: C:/QNX650/host/win32/x86/usr/lib/gcc/i486-pc-nto-qnx6.5.0/4.4.2/cc1plus caught signal 1
Build error occurred, build is stopped
Time consumed: 1128  ms.