Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Losing include paths in managed projects: (16 Items)
   
Losing include paths in managed projects  
When I make a managed C/C++ project in Momentix 4.6.0 using the QNX toolchain, entries are added to the 'Includes' 
section of the project for QNX system include paths.

When I add my own folders to the include path (C/C++ General/Paths And Symbols), the  QNX system paths are removed.

They were being replaced when I launched a build (IIRC).

In any case they're no longer being re-added.

The project still builds fine but the editor can no longer see any standard header files (eg stdio etc) and hence can't 
show source info but flags up lots warnings about headers and identifiers not being defined.

Any ideas on how to coax CDT to recreate these paths?  Or should I just give up and add them manually?
Re: Losing include paths in managed projects  
Hi, Chris,

This isn't a toolchain question, but an IDE question.  Please use the general-ide forum in future for IDE questions.

I suggest for Managed Make projects not to add include directories using the Paths and Symbols project properties page, 
but rather using the "C/C++ Build -> Settings" page.  This is where the configuration parameters for the managed build, 
among them include paths, are set.  The managed builder "pushes" some of these settings to other parts of the CDT system
.

Also, what are your Scanner Configuration Discovery settings on the "C/C++ Build -> Discovery" project properties page? 
 For example, do you have build output discovery enabled?  I recommend that together with the "per-project" scanner (not
 per-file).

If you find discovery getting messed up and symbols or include paths lingering when you thought you had removed them, 
then you can get a clean start by deleting the <project-name>.sc file from the <workspace-root>/.metadata/.plugins/org.
eclipse.cdt.make.core directory.

HTH,

Christian


On 15/04/10 08:10 AM, Chris Trobridge wrote: 

	When I make a managed C/C++ project in Momentix 4.6.0 using the QNX toolchain, entries are added to the 'Includes' 
section of the project for QNX system include paths.
	
	When I add my own folders to the include path (C/C++ General/Paths And Symbols), the  QNX system paths are removed.
	
	They were being replaced when I launched a build (IIRC).
	
	In any case they're no longer being re-added.
	
	The project still builds fine but the editor can no longer see any standard header files (eg stdio etc) and hence can't
 show source info but flags up lots warnings about headers and identifiers not being defined.
	
	Any ideas on how to coax CDT to recreate these paths?  Or should I just give up and add them manually?
	
	
	
	
	_______________________________________________
	
	General
	http://community.qnx.com/sf/go/post51744
	
	  



-- 
Christian W. Damus
Software Developer, IDE Team
QNX Software Systems <http://www.qnx.com/>;  
Re: Losing include paths in managed projects  
My apologies!

I saw the IDE forum after.  I classified this as CDT related, and the forum is labelled Core Development Tools, which 
obviously isn't quite the same CDT.

Can you move the thread?

I think I need to re-think this a little.

If Discovery is to allow the IDE to determine the include paths used by the build then this seems a little circular in a
 managed build.  In a managed build the IDE property pages are determining the directories used in the build, hence the 
IDE already knows theses.

It might manage to discover the system headers, however, these files are inserted by the QNX toolchain at the project 
creation - so the system headers do not appear to be being added by the discovery process.

Discovery would appear to be more suitable for an externally managed makefile?

"I suggest for Managed Make projects not to add include directories using the Paths and Symbols project properties page,
 but rather using the "C/C++ Build -> Settings" page.  This is where the configuration parameters for the managed build,
 among them include paths, are set.  The managed builder "pushes" some of these settings to other parts of the CDT 
system."

Actually the paths from the "Paths and Symbols" page are pushed into the "C/C++ Build/Settings" page.  But I haven done 
as you say and the project include paths are still discovered.

Still no system includes though.

Another difference is (on a new project) the QNX "Includes" entries have a yellow bottom, rather than a blue one and the
 QNX entries can be opened to reveal their contents - while the project "Includes" entries can't.

(I've also set my Discovery options back to the same as a new project - Configuration-wide, Automate discovery, Report 
problems,  Regular make - per project scanning and enable build output scanner info discovery etc.

I deleted the .sc files and they don't seem to be rebuilt all the time, but when I did I got the following in it:
<collector id="org.eclipse.cdt.make.core.PerProjectSICollector">
<includePath path="C:/QNX641/target/qnx6/usr/include"/>
<includePath path="C:/QNX641/host/win32/x86/usr/lib/gcc/i386-pc-nto-qnx6.4.0/4.3.3/include"/>
<includePath path="C:/QNX641/target/qnx6/usr/include/cpp/c"/>
<includePath path="C:/QNX641/target/qnx6/usr/include/cpp"/>
<definedSymbol symbol="__cplusplus"/>
...

So this file has the system includes in it (but not the project ones).

Regards
Re: Losing include paths in managed projects  
Hi, Chris,

No need to apologize.  That was just FYI.  I don't know that the thread can be "moved"; I wouldn't worry about that.

Yes, I think the the managed builder tries to integrate the settings from the Paths and Symbols page, but for myself, I 
try to consistently configure managed projects using the managed build settings.  Just in case, and because it's all 
accessible on the one page.

Discovery is intended to find the implicit include paths that are built into the toolchain, in this case QCC.  It is 
only needed by the CDT indexing subsystem, editors, and whatever else besides build that needs this information.  Build 
doesn't need it because the toolchain already knows these paths.  So, discovery does not push the paths and symbols that
 it finds into the project settings for the user to see them (although they are visible in some pages when you toggle 
the "show system" or "show built-in" buttons).

Discovery is always run on the creation of a new project, so this is why you see the system headers at the outset.  They
 should never then disappear.

The yellow folders in the Includes virtual folder denote external directories (not in the workspace).  The blue folders 
donate workspace projects and folders.

The .sc files should be re-built when you build the project (it is implemented as a Project Builder named "Scanner 
Discovery Builder" in the project settings, per the Eclipse Platform project builder framework).  They are also re-built
 whenever you change the discovery settings.  But, as I mentioned, they are always cumulative, so for a clean re-
calculation you have to delete the file.

Would you be able to craft a sample project that demonstrates the problem you are seeing, and attach it to a post?  At 
this point, I think I need to see it in action to get a better sense of how to resolve the situation.

Cheers,

Christian


On 15/04/10 09:57 AM, Chris Trobridge wrote: 

	My apologies!
	
	I saw the IDE forum after.  I classified this as CDT related, and the forum is labelled Core Development Tools, which 
obviously isn't quite the same CDT.
	
	Can you move the thread?
	
	I think I need to re-think this a little.
	
	If Discovery is to allow the IDE to determine the include paths used by the build then this seems a little circular in 
a managed build.  In a managed build the IDE property pages are determining the directories used in the build, hence the
 IDE already knows theses.
	
	It might manage to discover the system headers, however, these files are inserted by the QNX toolchain at the project 
creation - so the system headers do not appear to be being added by the discovery process.
	
	Discovery would appear to be more suitable for an externally managed makefile?
	
	"I suggest for Managed Make projects not to add include directories using the Paths and Symbols project properties page
, but rather using the "C/C++ Build -> Settings" page.  This is where the configuration parameters for the managed build
, among them include paths, are set.  The managed builder "pushes" some of these settings to other parts of the CDT 
system."
	
	Actually the paths from the "Paths and Symbols" page are pushed into the "C/C++ Build/Settings" page.  But I haven done
 as you say and the project include paths are still discovered.
	
	Still no system includes though.
	
	Another difference is (on a new project) the QNX "Includes" entries have a yellow bottom, rather than a blue one and 
the QNX entries can be opened to reveal their contents - while the project "Includes" entries can't.
	
	(I've also set my Discovery options back to the same as a new project - Configuration-wide, Automate discovery, Report 
problems,  Regular make - per project scanning and enable build output scanner info discovery etc.
	
	I deleted the .sc files and they don't seem to be rebuilt all the time, but when I did I got the following in it:
	<collector...
View Full Message
Re: Losing include paths in managed projects  
I deleted the projects and recreated them in place.

This seemed to work out until today when they have gone again.  There was a power-glitch that rebooted all our dev pcs 
so I don't know if this was an influence but it corrupted a file a colleague had open in Eclipse at the time on his pc.

This .cproject file is for a single source file project that references a library in another project in the workspace 
and has an include references the source folders in that project that contain pertinent  headers.

I find it odd that such a simple project is 100k+ of xml with a lot of repeated sections.

Is this where the problem is?

Regards
Attachment: Text .cproject 99.96 KB
Re: Losing include paths in managed projects  
Project storage implemented rather badly. It has a lot of duplicate for each configuration
and each toolchain. But I cannot see anything wrong with the file given quick look.
Re: Losing include paths in managed projects  
Thanks - I thought I was on to something as deleting the project and recreating it added 4 system paths by discovery.

However, when I restart Momentics there are only three and these vanish once I rebuild the project (but return if I 
restart Momentics again).

OTOH, deleting the entire workspace (.metadata folder) has no impact at all - still no system paths shown.
Re: Losing include paths in managed projects  
Included a simple project

When I first create the project there are 4 system include paths.
I can build as often as I like without affecting this unless I close the workspace.
When I restart Momentics the gcc system path is gone (3 left).
If I then build the project (assuming there's something to do) then I lose the other 3.
If I restart Momentics then I get the 3 (qnx) system paths back until I build again.
Attachment: Compressed file date.zip 28.24 KB
Re: Losing include paths in managed projects  
Hi, Chris,

Thanks for the sample project.  I am able to reproduce the problem in the IDE 4.6.1 release.  The problem is that the 
target platform selection in your project is for PPC SPE (as distinguished from plain PPC).  The scanner discovery 
profile for QCC is specifying the wrong compiler configuration ID for PPC SPE (ppcspe instead of ppcbespe), so it is 
finding no includes at all on a re-build.

In IDE 4.7 (not yet released, but there are milestone builds available for download) the situation is somewhat improved.
  The gcc include directory is still disappearing, but at least the other three are not.  So, something is definitely 
wrong, here.  I have raised a bug report internally to address this.  In the mean-time, see whether you can safely try 
out an IDE 4.7 build to resolve the most severe symptoms.

HTH,

Christian


On 20/04/10 11:32 AM, Chris Trobridge wrote: 

	Included a simple project
	
	When I first create the project there are 4 system include paths.
	I can build as often as I like without affecting this unless I close the workspace.
	When I restart Momentics the gcc system path is gone (3 left).
	If I then build the project (assuming there's something to do) then I lose the other 3.
	If I restart Momentics then I get the 3 (qnx) system paths back until I build again.
	
	
	
	_______________________________________________
	
	General
	http://community.qnx.com/sf/go/post52129
	  



-- 
Christian W. Damus
Software Developer, IDE Team
QNX Software Systems <http://www.qnx.com/>;  
Re: Losing include paths in managed projects  
Hi again, Chris,

Actually, on reflection, I think the only outstanding issue in the 4.7 IDE is that the GCC include path appears in the 
first place.  It really shouldn't, because it's an internal thing.  Unless your project is building a GCC tool ... :-)

Cheers,

Christian
Re: Losing include paths in managed projects  
Hi again, Chris,

I have since learned that these GCC headers are not internal, but may need to be referenced by user code for intrinsics 
and other compiler-dependent constructs.  So, I have raised a bug to ensure that these headers will appear consistently 
in managed projects and also in QNX Projects.

Thanks,

Christian
Re: Losing include paths in managed projects  
Thanks, I'm glad I waited for the whole story!

ppc-be-spe seems to be trouble all round ;).

I've tried 4.7 but it fails to build the (P2020RDB) BSP - perhaps it's binary compatibility with the pre-compiled 
modules?  The error meassages refer to failed link resolutions to what appear to be flash routines.

So it looks like we'll need to wait until the BSP is re-released for 6.5, which is a shame as it is finding all the 
system headers - the gcc path is there too but labelled as 'powerpc-nto-qnx6.5.0'

It's possible we'll decide that managed make is inadequate for us at some point.  If we switch to a "Make file" project,
 will this affect the situation?  I note that there is a field in the Discovery option for "Compiler Invocation Options"
, so perhaps this would over-ride the incorrect behaviour in the managed build?
Re: Losing include paths in managed projects  
You can use IDE 4.7 targeting SDP 6.4.1, you don't need to use 6.5

Chris Trobridge wrote:
> Thanks, I'm glad I waited for the whole story!
>
> ppc-be-spe seems to be trouble all round ;).
>
> I've tried 4.7 but it fails to build the (P2020RDB) BSP - perhaps it's binary compatibility with the pre-compiled 
modules?  The error meassages refer to failed link resolutions to what appear to be flash routines.
>
> So it looks like we'll need to wait until the BSP is re-released for 6.5, which is a shame as it is finding all the 
system headers - the gcc path is there too but labelled as 'powerpc-nto-qnx6.5.0'
>
> It's possible we'll decide that managed make is inadequate for us at some point.  If we switch to a "Make file" 
project, will this affect the situation?  I note that there is a field in the Discovery option for "Compiler Invocation 
Options", so perhaps this would over-ride the incorrect behaviour in the managed build?
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post52899
>
>   
Re: Losing include paths in managed projects  
Hi, Chris,

On the subject of makefile projects:  the discovery mechanism is identical as for managed make, so I wouldn't expect 
that to affect the include-path discovery.  From looking at the code, I think you should be able to override the qcc 
invocation in the Discovery settings page:  if the -V argument is already supplied, the IDE won't replace it.  So, you 
could add

   -V4.3.3,gcc_ntoppcbespe

(or whatever is appropriate for your compiler version).  I haven't tried this, but I think it should work.

Elena's suggestion will be simpler in the long run, anyhow.  :-)

cW


On 27/04/10 10:43 AM, Chris Trobridge wrote: 

	Thanks, I'm glad I waited for the whole story!
	
	ppc-be-spe seems to be trouble all round ;).
	
	I've tried 4.7 but it fails to build the (P2020RDB) BSP - perhaps it's binary compatibility with the pre-compiled 
modules?  The error meassages refer to failed link resolutions to what appear to be flash routines.
	
	So it looks like we'll need to wait until the BSP is re-released for 6.5, which is a shame as it is finding all the 
system headers - the gcc path is there too but labelled as 'powerpc-nto-qnx6.5.0'
	
	It's possible we'll decide that managed make is inadequate for us at some point.  If we switch to a "Make file" project
, will this affect the situation?  I note that there is a field in the Discovery option for "Compiler Invocation Options
", so perhaps this would over-ride the incorrect behaviour in the managed build?
	
	
	
	_______________________________________________
	
	General
	http://community.qnx.com/sf/go/post52899
	
	  



-- 
Christian W. Damus
Software Developer, IDE Team
QNX Software Systems <http://www.qnx.com/>;  
Re: Losing include paths in managed projects  
Yes, thanks to you both.

I think I'd slightly misunderstood the point of reconfiguring Momentics.

I've retargetted 4.7 to use 6.4.1 and it compiles fine!
Re: Losing include paths in managed projects  
The SPE reference tweaked my curiosity.  At the risk of unnecessarily
adding complications to an apparently resolved issue, I thought I'd chip
in (albeit late, and without reading the rest of the thread, so ignore
me if this isn't germane).

Keep in mind that if you're using the ppcbe-spe target, you must be
certain that you are compiling applications with -me500v2 and linking
against libraries likewise compiled -- in particular the libc from the
ppcbe-spe target.  Note that bootstrap executables (e.g. startup,
procnto) as opposed to applications should probably NOT be built that
way -- just use the "normal" ppcbe bootstaps.  (As with most things in
software, it is possible to bend these rules but only if you are really,
really certain that you know what you're doing because otherwise madness
and despair await :-)

Most or all of this should be guaranteed by the IDE anyway, but it's
worth checking if you're running into difficulties.

Again, apologies in advance if I've needlessly complicated things.

Regards,
Neil