How can I use a function written within a .cpp saved in a folder different from the one that needs that function? For all the .cpp of the first folder I've simply added an #include
to the .h of the cpp (and it works fine), but trying to add an #include "..\Folder1\....h"
to all the .cpp of the second folder is not enough and the Borland C++ Builder gives me the Unresolved external
error.
What can I do?
Thanks
Asked
Active
Viewed 187 times
0
-
6add the location of the object files to your linker search path – Agnel Kurian Jul 02 '12 at 13:21
-
@Agnel Kurian - You should put this as your answer :-) – trumpetlicks Jul 02 '12 at 13:24
-
@trumpetlicks, OK. If anyone knows how it is done on Borland C++ Builder, please answer. – Agnel Kurian Jul 02 '12 at 13:25
2 Answers
1
You need to compile the cpp file into an object file (.o) inside its own directory and link that object file with your program.

perreal
- 94,503
- 21
- 155
- 181
1
Add the location of the object files to your linker search path.

Community
- 1
- 1

Agnel Kurian
- 57,975
- 43
- 146
- 217
-
Ok, but the problem is that I don't know how to do that on Borland C++ Builder – Ant4res Jul 02 '12 at 13:26
-
Does this help (via google)? http://www.webnms.com/cagent/help/porting_guide/compilers/images/setting.jpg Try "Library path". – Agnel Kurian Jul 02 '12 at 13:32