 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Sat Jan 03, 2004 11:44 pm Post subject: Including object files in a project |
|
|
Hi all,
I'm afraid that I have a kind of a 'newbie' question, but I cannot find the
answer in either C++ builder documentation or the internet.
The problem is as follows, I have created progam that includes different
source files. One of these source files includes other source files. (F.E.
include1.h includes partA.h and partB.h)
In a new project I want to use include1.h again by adding is include1.obj to
the project.
Compiling will cause errors of the type [Linker Error] Unresolved external
'X' referenced from 'include1.obj'.
So now I'm forced to include both partA.obj and partB.obj files into the
project file. AND I DO NOT WANT THIS. I just want to refer to the 'parent'
file. (in this case include1.h)
How do you normally handle multiple files which you want to share between
projects? Creating a DLL or package might be a little over the top here.
Hope one of you can help me out,
Thanks in advance.
Oscar
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Sun Jan 04, 2004 10:09 am Post subject: Re: Including object files in a project |
|
|
oscar(at)safekimono(dot)nl wrote:
| Quote: | The problem is as follows, I have created progam that includes different
source files. One of these source files includes other source files. (F.E.
include1.h includes partA.h and partB.h)
|
That are not sourcefiles I would say. h files are header files.
| Quote: | In a new project I want to use include1.h again by adding is include1.obj to
the project.
|
Again that is a misconception. h files do not cause for obj files.
You will only get an obj file if you compile a c/cpp file.
You will have to make a cpp file like include1.cpp that includes
partA.cpp and partB.cpp.
Hans.
|
|
| Back to top |
|
 |
Oscar van den Bosch Guest
|
Posted: Sun Jan 04, 2004 1:47 pm Post subject: Re: Including object files in a project |
|
|
| Quote: | You will have to make a cpp file like include1.cpp that includes
partA.cpp and partB.cpp.
|
I know but sorry, this is not the question. Maybe I am unclear, but I
find it hard to describe the problem. I am always using the builder
interface, so i dont have to worry about linking or makefiles.
I just want to add the compiled source (include1.obj) to a project and
dont want to add its dependencies (partA.obj, partB.obj).
Its very annoying when I add a new dependency to include1 (f.e. partC)
and have to add (partC.obj) to each project which uses include1.obj.
Oscar
|
|
| Back to top |
|
 |
Detlef Guest
|
Posted: Mon Jan 05, 2004 10:35 am Post subject: Re: Including object files in a project |
|
|
"Hans Galema" <dontusethis (AT) dontusethis (DOT) nl> schrieb im Newsbeitrag
news:3ff7e567 (AT) newsgroups (DOT) borland.com...
| Quote: | oscar(at)safekimono(dot)nl wrote:
The problem is as follows, I have created progam that includes different
source files. One of these source files includes other source files.
(F.E.
include1.h includes partA.h and partB.h)
That are not sourcefiles I would say. h files are header files.
In a new project I want to use include1.h again by adding is
include1.obj to
the project.
Again that is a misconception. h files do not cause for obj files.
You will only get an obj file if you compile a c/cpp file.
You will have to make a cpp file like include1.cpp that includes
partA.cpp and partB.cpp.
Hans.
|
And at the end, if you want to use this code serveral times you should
create a library file ( start with a static one). And than you add this lib
file to your project.
Detlef
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|