Share functionality
-
Hi, I have a header file which is included in 1 project which has to be included in another too. I can copy it to the other project and then include it, but when the header changes i have to copy the file again to the other location. How can i easily maintain only 1 version of that file? I have seen i can import a header file from another location, but when i do #include "Myheader.h" or #include the header isn't found neither. Can you help?
-
Hi, I have a header file which is included in 1 project which has to be included in another too. I can copy it to the other project and then include it, but when the header changes i have to copy the file again to the other location. How can i easily maintain only 1 version of that file? I have seen i can import a header file from another location, but when i do #include "Myheader.h" or #include the header isn't found neither. Can you help?
You need to ensure that the location of MyHeader.h is in the include path for both of your projects. Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain) -
You need to ensure that the location of MyHeader.h is in the include path for both of your projects. Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)First of all, thanks for the reply. I had included the location of 'Myheader.h' file in the first project like 'C:\vss\'. I knew it was going to be in a subdirectory of 'C:\vss'. I've now replaced it with the exact directory and now the compiler finds the file!! Really strange. (No recursive search?) I've alsoo written a class in project 2 that needs to be accessed from project 1 alsoo. I have set my include paths correctly. It links in project2 correctly but in project1 it receives errors while linking. If i put the files in directory of project 2, the class compiles without a problem. How is this possible?
-
First of all, thanks for the reply. I had included the location of 'Myheader.h' file in the first project like 'C:\vss\'. I knew it was going to be in a subdirectory of 'C:\vss'. I've now replaced it with the exact directory and now the compiler finds the file!! Really strange. (No recursive search?) I've alsoo written a class in project 2 that needs to be accessed from project 1 alsoo. I have set my include paths correctly. It links in project2 correctly but in project1 it receives errors while linking. If i put the files in directory of project 2, the class compiles without a problem. How is this possible?
Are you talking about a header file and a lib ? If so you need to ensure the compiler knows where the .lib file is also. It isn't sufficient to just state where the header is. Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain) -
Are you talking about a header file and a lib ? If so you need to ensure the compiler knows where the .lib file is also. It isn't sufficient to just state where the header is. Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain) -
What is the link error message you are receiving? Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)