Linking to another project [SOLVED]
-
My directory structure is like the following
Solution Directory
--Project1
--Project2From
Project2
, I have to use classes written inProject1
. I have included the header files like the below inProject2
#include "../Project1/SomeHeader.h"
I can see the classes in intellisense but the problem occured with linker. It is saying about unresolved external symbols. I am looking for a method to link the file to
Project1
. Any thoughts? EDIT: I solved it by adding the project dependencies.Right click on the project -> Project dependencies -> Check the Project1
, save and build. :) I'd like to hear from you guys that is this the right approach to solve the above described problem? Thanksmodified on Monday, December 29, 2008 11:25 PM
-
My directory structure is like the following
Solution Directory
--Project1
--Project2From
Project2
, I have to use classes written inProject1
. I have included the header files like the below inProject2
#include "../Project1/SomeHeader.h"
I can see the classes in intellisense but the problem occured with linker. It is saying about unresolved external symbols. I am looking for a method to link the file to
Project1
. Any thoughts? EDIT: I solved it by adding the project dependencies.Right click on the project -> Project dependencies -> Check the Project1
, save and build. :) I'd like to hear from you guys that is this the right approach to solve the above described problem? Thanksmodified on Monday, December 29, 2008 11:25 PM
What kind of projects are Project1 and Project2 ? Is Project1 a library ? If yes, then your approach is the correct one (of course you need to add the library in the project settings of Project2).
Cédric Moonen Software developer
Charting control [v1.5] OpenGL game tutorial in C++ -
What kind of projects are Project1 and Project2 ? Is Project1 a library ? If yes, then your approach is the correct one (of course you need to add the library in the project settings of Project2).
Cédric Moonen Software developer
Charting control [v1.5] OpenGL game tutorial in C++Cedric Moonen wrote:
Is Project1 a library
Yes.
Project1
is a library.Cedric Moonen wrote:
of course you need to add the library in the project settings of Project2
Did you mean the linker settings? If yes, I haven't done that but the build and linking was successful. Am I missing something?
-
Cedric Moonen wrote:
Is Project1 a library
Yes.
Project1
is a library.Cedric Moonen wrote:
of course you need to add the library in the project settings of Project2
Did you mean the linker settings? If yes, I haven't done that but the build and linking was successful. Am I missing something?
Christian Flutcher wrote:
If yes, I haven't done that but the build and linking was successful
That's a bit strange... Normally you should have added it in the project properties: "Linker" category" -> "Input" and you should add it in the "Additional Dependencies". EDIT: or another way to do it is to make use of a #pragma. That's what you did maybe ? In such case, you don't need to change the properties of project 2.
Cédric Moonen Software developer
Charting control [v1.5] OpenGL game tutorial in C++