I’m using eclipse for the first time. I’m a seasoned VisualStudio user, so I’m trying to find similar functionality in eclipse. I have two projects, A and B. Project A spits out libA.a when it’s done compiling. Project B links against libA.a. Here is my problem.
- I compile project A then project B, everything is fine.
- I make a code change to project A that requires a build of project A.
- I try to build project B, but it states that no changes have been detected.
How do I make project B aware of the output of project A?? Currently I’m having to do a clean build of project B for it to re-link against libA.a.
Thanks.
EDIT: In my ProjectB->Path and Symbols->References tab, I have project A checked. This doesn’t relink after project A is rebuilt.
One can work around this problem by using the
touchcommand.In Eclipse, as part of C/C++ Build/Settings is the tab ‘Build Steps’. In the pre-build steps command line, enter
touch filename.filenameis any file in your application. This could be the file withmain(). This could be a special file just for this workaround,touchdummy.c, which can be a tiny file, which compiles quickly.When the application builds, even if you didn’t change any sources, the
touchcommand causes make to rebuild the application. If the library was rebuilt, then the application gets rebuilt with the new library.One can read about how
touchaffects the date/time of the file here.http://pubs.opengroup.org/onlinepubs/9699919799/utilities/touch.html
Edit: The exact command in Eclipse would be touch
${ProjDirPath}/src/main.cEdit: This command should work, but it appears that if the ‘main’ project did not change, the pre-build step is not executed. Also the
touchcommand causes eclipse to prompt to reload the file it touched. A large annoyance.