Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Linux Tools Project » importing files as links
importing files as links [message #655222] Fri, 18 February 2011 16:47 Go to next message
No real name is currently offline No real nameFriend
Messages: 53
Registered: July 2009
I have a header file (DataLogger.h) and and implementation file
(DataLogger.cpp) in one project, call it Project1.

From another project, Project2, I used the import wizard to get the
equivalent of a soft link to the DataLogger files.

The result was an entry in the .project file(Project2):
<location>/home/rgeddes/books/Project1/DataLogger.h</location >

I could also see additional resources in Project2 (Project Explorer
View) that looked like project source/header files but with decorations
that looked like arrows (I assume representing links)

I was expecting the preprocessor to see these links as well, but it
balks at:

#include "DataLogger.h" //No such file

I can get through compilation if the path to DataLogger.h is specified:

#include "../Project1/DataLogger.h" //OK

Is there a way to get the preprocessor #include to work with the project

Making sym links through the os works ok.

Re: importing files as links [message #655873 is a reply to message #655222] Tue, 22 February 2011 23:56 Go to previous message
Jeff Johnston is currently offline Jeff JohnstonFriend
Messages: 212
Registered: July 2009
Senior Member
The key thing here to note is that you are creating links via Eclipse and compiling with gcc.

gcc knows nothing about Eclipse so doesn't know about .project files or Eclipse locations. It accesses the file system so as you already know, sym links via the OS work.

What you can do is add your Project1 to the include path for the compilation. You can do this a number of ways depending on what kind of C Project you have.
Previous Topic:Cannot rebuild opxml, undefined reference to dlopen
Next Topic:Error loading control flow pane
Goto Forum:

Current Time: Fri Oct 15 21:36:34 GMT 2021

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

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

Back to the top