Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Unexpected file linking(Linked C++ source file #including not-linked header file)
Unexpected file linking [message #1792825] Tue, 24 July 2018 13:46
Keith Suddick is currently offline Keith SuddickFriend
Messages: 1
Registered: July 2018
Junior Member
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.

Many thanks.
Previous Topic:simple CDT plugin/toolchain creation
Next Topic:How To Save Build Configuration
Goto Forum:

Current Time: Mon Nov 19 03:52:53 GMT 2018

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

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

Back to the top