Posted by El Kabong on August 15, 2001 at 05:19:03:
In Reply to: Re: i code better after ive had a few ... posted by kalpol on August 14, 2001 at 19:13:03:
That should wokr in certain cases ... reordering the .cpp files on the g++ command line should fix it too. Based on my indepth, trial and error research into the problem (read: drank myself into a bloody stupor), i believe that it returns this error when g++ tries to compile your .cpp files before compiling the respective .h files, or something similar. In any case, the order in which g++ compiles yer .cpp files clearly matters when you have a veritable web of includes between all of yer .cpp files
in short, if you anyone gets this error, try reordering your .cpp files on the g++ command line
: : Oh ...... my ... god .......
: : I fized it! I fixed it! I finally figured out how to get g++ to compile these things properly!
: : I should get a field's medal for this.
: :
: : : I'm sure this has been answered a few times before, but i completely forgot how I got rid of these the first time ... anyway, does anyone know what to do about these sort of errors?
: : : /tmp/ccfZieny.o: In function `main': :
: : : /tmp/ccfZieny.o(.text+0x2b): undefined reference to `map
: : : /tmp/ccfZieny.o: In function `foostring::~foostring(void)':
: : : /tmp/ccfZieny.o(.gnu.linkonce.t._._9foostring+0x27): undefined reference to `foo
: : : ::~foo(void)'
: : : collect2: ld returned 1 exit status
: well, dvw told me this morning to do g++ *.cpp instead of g++ test.cpp....i never thought of that and it worked