This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
undefined references when i try to link a .cc file which contains classes
- From: Eilmsteiner Reinhard <r dot eilmsteiner at paysafecard dot com>
- To: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 9 Jan 2003 16:33:16 +0100
- Subject: 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?