![]() |
| ||
| #include custom files Hello, in 'cpp' code if I wish to include a header file its .H...ie //function definitions are located in function.h . The implementation is loaded in functions.cpp, however some of the functions take parameters created in main. Therefore rather than including the following: Quote:
Is the quote way the only way to fix it? Cheers |
| ||
| Re: #include custom files never never include *.cpp files inside othere *.cpp files. The *.cpp files should be compiled separately and both linked together. The header.h file should be included in both *.cpp files // header.cpp // main.cpp now depending on the compiler you should have a project that includes both *.cpp files and links them both along with other system libraries to produce the final executable program. |
| ||
| Re: #include custom files ok then this aint working right...at the moment i have... in main.cpp
the reason I've done it because its compiles... if I did this: main.cpp and try and compile that I get over 73 error messages since some varibles that main create are used in the functions........ |
| ||
| Re: #include custom files I thought we went through this already. http://www.daniweb.com/techtalkforums/post106155-6.html http://www.daniweb.com/techtalkforum...169#post106169 Is this something new and different? |
| ||
| Re: #include custom files DUH!! taking a break and comming back helps! I had 2 .H files that both needed including in the .cpp file! Thanks lads for your help, most appricated :D |
| All times are GMT -4. The time now is 10:30 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC