This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

undefined references when i try to link a .cc file which contains classes


Hello Everybody!

1. I have a <class>.cc file which contains the implementation of a class
2. I have a <class>.h file that contains the associated header
3. I compile the <class>.cc file
4. I put the object file <class.o> into an archive lib<class>.a (ar rcs ...)
5. I compile the main program <prog>.cc
6. I try to link the things (g++ -lg++ -L. -l<class> -o <prog> <prog>.o)
7. I get an "undefined references" error for each and every time i try to
call any method within the class in the library from <prog>.

8. ******************* Why? *************************

9. Any ideas?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]