Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Not building on header file change
icon9.gif  Not building on header file change [message #797440] Mon, 13 February 2012 13:41 Go to next message
Emil B is currently offline Emil B
Messages: 12
Registered: October 2010
Junior Member
Hi,

I have Eclipse Platform 3.7.1.M20110909-1335 and CDT 8.0.0.2.

When I want to do 'Build All' headers from other workspace projects are not counted as dependencies, and nothing is rebuilt.

I have a hello world application and a static library project.
The static library is set as a reference in Project Properties -> c/c++ general -> Paths and SYmbols -> References tab -> checked 'Active'. That's the only setting I changed.

By the way, It totally beats me why Eclipse has an additional "Project References" top-level item under Project Properties.


Anyway, I tried both the External Builder (which gets selected by default on project creation) and the INternal Builder, also coupled with combinations of the global setting 'Preferences -> c++ -> Build -> Build configurations only when there are Eclipse resource changes........'



Needless to say, it's upsetting that such things doesn't work out of the box. Any Ideas? Thanks in advance.

[Updated on: Mon, 13 February 2012 13:42]

Report message to a moderator

Re: Not building on header file change [message #797566 is a reply to message #797440] Mon, 13 February 2012 16:48 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
It sounds like you set the dependency on a library not on header files. If you have no dependency on the changed header files, then there is no reason to build anything.
Re: Not building on header file change [message #797575 is a reply to message #797566] Mon, 13 February 2012 17:00 Go to previous messageGo to next message
Emil B is currently offline Emil B
Messages: 12
Registered: October 2010
Junior Member
David Wegener wrote on Mon, 13 February 2012 18:48
It sounds like you set the dependency on a library not on header files. If you have no dependency on the changed header files, then there is no reason to build anything.


Of course there is. A change in the binary library (.a file) reflects a change in the implementation, an a change in its headers reflects a change of interface as well.

In eclipse you don't get to choose whether to place dependency on the headers or binary, you just specify the library project as a whole. Depending on what changed in this project (interface of just implementation), the dependent project needs to recompile or merely re-link.

But it's g++ job to do that, I really don't understand why it's not working.

[Updated on: Mon, 13 February 2012 17:00]

Report message to a moderator

Re: Not building on header file change [message #797580 is a reply to message #797575] Mon, 13 February 2012 17:07 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
Have you exported the includes in the library project? C++ General Properties->Paths and Symbols->Includes. Select the include folder that contains the headers you depend on and click the Export button.
Re: Not building on header file change [message #797591 is a reply to message #797580] Mon, 13 February 2012 17:16 Go to previous messageGo to next message
Emil B is currently offline Emil B
Messages: 12
Registered: October 2010
Junior Member
David Wegener wrote on Mon, 13 February 2012 19:07
Have you exported the includes in the library project? C++ General Properties->Paths and Symbols->Includes. Select the include folder that contains the headers you depend on and click the Export button.


What does it mean to 'Export' the headers? I tried to do it on the library includes in the executable project, to no effect. The include path (-I) is listed there and I can see it in the console output.

Thanks,
Haelix
Re: Not building on header file change [message #829809 is a reply to message #797591] Mon, 26 March 2012 20:26 Go to previous messageGo to next message
Emil B is currently offline Emil B
Messages: 12
Registered: October 2010
Junior Member
Hi!

Any thoughts on this? Anyone? Thank you.
Re: Not building on header file change [message #910753 is a reply to message #797440] Mon, 10 September 2012 10:34 Go to previous messageGo to next message
Emil B is currently offline Emil B
Messages: 12
Registered: October 2010
Junior Member
Hi again, is no one else experiencing this?

This seems like really basic functionality, to me.

There are 2 stackoverflow questions on this, no solution.

stackoverflow.com/questions/6822927/eclipse-cdt-rebuilding-a-dependent-project
stackoverflow.com/questions/9884827/eclipse-cdt-not-building-project-on-header-file-change


Bounties, anyone?
Re: Not building on header file change [message #987112 is a reply to message #910753] Fri, 23 November 2012 14:53 Go to previous messageGo to next message
Andy Ed is currently offline Andy Ed
Messages: 41
Registered: December 2009
Member
Yes I'm getting this problem. Have you found a solution?
Re: Not building on header file change [message #987115 is a reply to message #910753] Fri, 23 November 2012 15:06 Go to previous messageGo to next message
Andy Ed is currently offline Andy Ed
Messages: 41
Registered: December 2009
Member
Ahh, I solved this by re-indexing the project; right-clicking on project-index-rebuild. I guess the index is updated by the builder, and a change to the header file does not cause a re-build. The index must be manually invoked, it seems.
Re: Not building on header file change [message #1022681 is a reply to message #987115] Fri, 22 March 2013 10:49 Go to previous messageGo to next message
Krzysztof Czaiński is currently offline Krzysztof Czaiński
Messages: 4
Registered: March 2013
Junior Member
Hi,
So what exactly do I need to make this work?

I have in my workspace:
1. Project deptest_lib with files:
include/a.h
a.cpp
The include folder is exported (C++ General Properties->Paths and Symbols->Includes).
This project creates an (empty) library file.
2. Project deptest_main with file:
deptest_main.cpp <- this file #includes <a.h>
This project is set up to reference deptest_lib (Project Properties -> c/c++ general -> Paths and SYmbols -> References tab -> checked 'Active').

All compiles fine, but rebuilding deptest_main doesn't notice any changes to a.h. That is, Eclipse doestn't create a dependancy deptest_main.cpp : a.h.

Reindexing doesn't help.

Can and how can this be set-up to reflect (and autogenerate) the real dependencies?

This is a simplified example, but I am very interested in getting this to work, because it would help me a lot with more complicated projects I am working on.

Thanks in advance for any help with this. I'll be happy to shere the example projects if anyone wolud like to take a look.

Regards,
Kris
Re: Not building on header file change [message #1023801 is a reply to message #1022681] Mon, 25 March 2013 07:38 Go to previous messageGo to next message
Emil B is currently offline Emil B
Messages: 12
Registered: October 2010
Junior Member
Hello, I haven't been able to find a fix for this.

I can't understand why there's so few that report this problem (and that was no bug for this).

On 2012-04-01 i filed this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=375800


May ba you want to hop in and vote on it.
Re: Not building on header file change [message #1023806 is a reply to message #1023801] Mon, 25 March 2013 07:55 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1963
Registered: July 2009
Senior Member
Emil B wrote on Mon, 25 March 2013 08:38
Hello, I haven't been able to find a fix for this.

I can't understand why there's so few that report this problem (and that was no bug for this).

On 2012-04-01 i filed this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=375800


May ba you want to hop in and vote on it.

There is a similar https://bugs.eclipse.org/bugs/show_bug.cgi?id=210248 which should have been fixed. Do you use the internal builder?


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Not building on header file change [message #1023850 is a reply to message #1023806] Mon, 25 March 2013 09:52 Go to previous messageGo to next message
Emil B is currently offline Emil B
Messages: 12
Registered: October 2010
Junior Member
Axel Mueller wrote on Mon, 25 March 2013 09:55
Emil B wrote on Mon, 25 March 2013 08:38
Hello, I haven't been able to find a fix for this.

I can't understand why there's so few that report this problem (and that was no bug for this).

On 2012-04-01 i filed this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=375800


May ba you want to hop in and vote on it.

There is a similar https://bugs.eclipse.org/bugs/show_bug.cgi?id=210248 which should have been fixed. Do you use the internal builder?


Hi, this bug seems to refer to slightly something else, namely, the re-linking of dependent projects afer the code (cpp) of the library has changed (not the interface). This indeed works. I'm having a header dependency problem, the dependent project should re-compile. The target milestone for that bug is 8.0.2 and I'm using >8.10. My problem reproduces using either the internal or external builder. Have tried countless combinations of settings and nothing works. I even tried past eclipse releases to see if this is a regression bug, doesn't work in any I tried.
Re: Not building on header file change [message #1027719 is a reply to message #1023850] Wed, 27 March 2013 10:19 Go to previous message
Krzysztof Czaiński is currently offline Krzysztof Czaiński
Messages: 4
Registered: March 2013
Junior Member
Emil B wrote on Mon, 25 March 2013 05:52
Axel Mueller wrote on Mon, 25 March 2013 09:55
Emil B wrote on Mon, 25 March 2013 08:38
Hello, I haven't been able to find a fix for this.

I can't understand why there's so few that report this problem (and that was no bug for this).

On 2012-04-01 i filed this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=375800


May ba you want to hop in and vote on it.

There is a similar https://bugs.eclipse.org/bugs/show_bug.cgi?id=210248 which should have been fixed. Do you use the internal builder?


Hi, this bug seems to refer to slightly something else, namely, the re-linking of dependent projects afer the code (cpp) of the library has changed (not the interface). This indeed works. I'm having a header dependency problem, the dependent project should re-compile. The target milestone for that bug is 8.0.2 and I'm using >8.10. My problem reproduces using either the internal or external builder. Have tried countless combinations of settings and nothing works. I even tried past eclipse releases to see if this is a regression bug, doesn't work in any I tried.


Yes, Emil, your bug is exactly what I mean and it is *not* fixed. And yes, the other bug is different, and I'm glad and confirm, that the other bug is fixed.

I use the internal builder. Other builders can't find "make" command.

Let's hope we can get someone's attention to this bug...

Regards,
Kris
Previous Topic:Invoking CDT debugger Programmatically
Next Topic: Can't make CodeSourcery G++ for ARM m4 work on Eclipse
Goto Forum:
  


Current Time: Mon Oct 20 08:07:20 GMT 2014

Powered by FUDForum. Page generated in 0.02631 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software