Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » shared source files
shared source files [message #137561] Fri, 04 February 2005 09:40 Go to next message
Eclipse UserFriend
Originally posted by: nik.cain.neuf.fr

hi again,

my last post reminded me of another question, but I thought I should keep
it in a separate thread.

If several projects share common source code (ie a header file of
definitions), how do I add that to my workspace without creating a project
for it? Or, as an alternative, how do I have each project that uses it
show it in it's own project space, even though the file isn't in the same
folder? (does that make sense?).

thanks,
nik
Re: shared source files [message #137888 is a reply to message #137561] Fri, 04 February 2005 17:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alain.nowhere.ca

Nik wrote:

> hi again,

> my last post reminded me of another question, but I thought I should keep
> it in a separate thread.

> If several projects share common source code (ie a header file of
> definitions), how do I add that to my workspace without creating a project
> for it? Or, as an alternative, how do I have each project that uses it
> show it in it's own project space, even though the file isn't in the same
> folder? (does that make sense?).

heu ... try us again with some hardcore details.
Re: shared source files [message #138001 is a reply to message #137888] Sat, 05 February 2005 08:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nik.cain.neuf.fr

alain wrote:
> Nik wrote:
>
>> hi again,
>
>
>> my last post reminded me of another question, but I thought I should
>> keep it in a separate thread.
>
>
>> If several projects share common source code (ie a header file of
>> definitions), how do I add that to my workspace without creating a
>> project for it? Or, as an alternative, how do I have each project that
>> uses it show it in it's own project space, even though the file isn't
>> in the same folder? (does that make sense?).
>
>
> heu ... try us again with some hardcore details.
>
>

ok.

I have three libraries that share a common header file - the header file
has a few definitions and some inline helper funcs that all the
libraries use.

My folder structure is

root -
Common (contains that header)
src for Lib1
src for Lib2
src for Lib3

I have added each Lib as a managed make project, and in the C/C++ I can
see the src for each project, but the common header isn't there. If I
add it myself, it seems I have to add it as a project in its own right,
but I don't want to do that since it's only a header and won't be a lib
etc.

I thought adding a source folder (right click-> New-> Source Folder)
sounded the right thing, but it looks like I can only add folders that
are children of the project folder. Maybe a source folder isn't what I
thought it was (in which case, what is it?).

Ultimately, I want to see the header file in that C/C++ Projects tab so
I can click on it and edit it (I haven't yet seen a way of opening files
in the ide that aren't in the projects list)...

Is that clearer, or still mud like?

thanks,
nik
Re: shared source files [message #138379 is a reply to message #138001] Thu, 10 February 2005 23:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alain.nowhere.ca

Nicholas Cain wrote:

> alain wrote:
>> Nik wrote:
>>
>>> hi again,
>>
>>
>>> my last post reminded me of another question, but I thought I should
>>> keep it in a separate thread.
>>
>>
>>> If several projects share common source code (ie a header file of
>>> definitions), how do I add that to my workspace without creating a
>>> project for it? Or, as an alternative, how do I have each project that
>>> uses it show it in it's own project space, even though the file isn't
>>> in the same folder? (does that make sense?).
>>
>>
>> heu ... try us again with some hardcore details.
>>
>>

> ok.

Sorry for the delay.

> I have three libraries that share a common header file - the header file
> has a few definitions and some inline helper funcs that all the
> libraries use.

> My folder structure is

> root -
> Common (contains that header)
> src for Lib1
> src for Lib2
> src for Lib3

> I have added each Lib as a managed make project, and in the C/C++ I can
> see the src for each project, but the common header isn't there. If I
> add it myself, it seems I have to add it as a project in its own right,
> but I don't want to do that since it's only a header and won't be a lib
> etc.

Why not ? Just add it as a std make Project with a Makefile
with empty targets :clean and all.
Or by disabling the builder for the project, see the Builder Property
page.

> I thought adding a source folder (right click-> New-> Source Folder)
> sounded the right thing, but it looks like I can only add folders that
> are children of the project folder. Maybe a source folder isn't what I
> thought it was (in which case, what is it?).

> Ultimately, I want to see the header file in that C/C++ Projects tab so
> I can click on it and edit it (I haven't yet seen a way of opening files
> in the ide that aren't in the projects list)...

I simply do not see the resitance of putting the common folder
as a project ... albeit a project will no real builders.

> Is that clearer, or still mud like?

> thanks,
> nik
Re: shared source files [message #138413 is a reply to message #138379] Fri, 11 February 2005 08:24 Go to previous message
Eclipse UserFriend
Originally posted by: nik.cain.neuf.fr

alain wrote:
> Nicholas Cain wrote:
>
>> alain wrote:
>>
>>> Nik wrote:
>>>
>>>> hi again,
>>>
>>>
>>>
>>>> my last post reminded me of another question, but I thought I should
>>>> keep it in a separate thread.
>>>
>>>
>>>
>>>> If several projects share common source code (ie a header file of
>>>> definitions), how do I add that to my workspace without creating a
>>>> project for it? Or, as an alternative, how do I have each project
>>>> that uses it show it in it's own project space, even though the file
>>>> isn't in the same folder? (does that make sense?).
>>>
>>>
>>>
>>> heu ... try us again with some hardcore details.
>>>
>>>
>
>> ok.
>
>
> Sorry for the delay.
>
>> I have three libraries that share a common header file - the header
>> file has a few definitions and some inline helper funcs that all the
>> libraries use.
>
>
>> My folder structure is
>
>
>> root -
>> Common (contains that header)
>> src for Lib1
>> src for Lib2
>> src for Lib3
>
>
>> I have added each Lib as a managed make project, and in the C/C++ I
>> can see the src for each project, but the common header isn't there.
>> If I add it myself, it seems I have to add it as a project in its own
>> right, but I don't want to do that since it's only a header and won't
>> be a lib etc.
>
>
> Why not ? Just add it as a std make Project with a Makefile
> with empty targets :clean and all.
> Or by disabling the builder for the project, see the Builder Property
> page.
>
>> I thought adding a source folder (right click-> New-> Source Folder)
>> sounded the right thing, but it looks like I can only add folders that
>> are children of the project folder. Maybe a source folder isn't what I
>> thought it was (in which case, what is it?).
>
>
>> Ultimately, I want to see the header file in that C/C++ Projects tab
>> so I can click on it and edit it (I haven't yet seen a way of opening
>> files in the ide that aren't in the projects list)...
>
>
> I simply do not see the resitance of putting the common folder
> as a project ... albeit a project will no real builders.
>
>> Is that clearer, or still mud like?
>
>
>> thanks,
>> nik
>
>
>


oh, of course. Thanks, that makes sense. I'd just assumed every project
had to 'build' something...

many thanks,
nik
Previous Topic:Status of cppunit
Next Topic:Debugger "Launching error"
Goto Forum:
  


Current Time: Thu Dec 26 22:03:42 GMT 2024

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

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

Back to the top