|Unexpected file linking [message #1792825]
||Tue, 24 July 2018 13:46
| Keith Suddick
Registered: July 2018
I have some C++ code that currently compiles fine as a standalone project (Project A). It provides some basic functionality that I want to use in a number of other projects each of which will add some additional code to customise the functionality. I'm working on the first customisation at the moment (Project B).|
In Project A there is a header file that causes the Project A code to compile with some default functions using simple preprocessor #if's etc. and this creates the standalone application that is useful for testing.
The plan was to create a link in Project B to just the .cpp file in Project A. Project B would have it's own version of the .h file (that causes the default functions from the linked code to be excluded) but has additional source files that replace them with the customised code.
When I create a link in Project B to just the .cpp file in Project A the file does indeed appear in Project B, it is correctly linked so changes to that file are reflected in both projects.
But, the linked .cpp file in Project B continues to #include the .h file from Project A even though I can no references to Project A anywhere (include paths, pre-processor etc) other than in the path to the linked .cpp file itself.
Can anyone help me understand how Project B is #including the .h file from Project A or more importantly how I can stop it? Is there a way to make Project B use its own version of the .h file?
I've tried to strip the situation back to basics here but for both projects I'm using the Arduino IDE under Eclipse Photon (4.8.0) but my instinct is it's to do with the underlying Eclipse/CDT file linking.
My searches so far only seem to be returning info on how to create links not the after effects so to speak.
Any suggestions would be much appreciated.
Powered by FUDForum
. Page generated in 0.01479 seconds