Date: Wed, 24 Sep 1997 16:56:48 -0700 (PDT) Message-Id: <199709242356.QAA22556@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: "Geoff Weber" From: Nate Eldredge Subject: RE: "Why 'undefined reference' in link?" Cc: djgpp AT delorie DOT com Precedence: bulk At 10:28 9/24/1997 -0500, Geoff Weber wrote: >I was asked to supply more details on the problem below, so >here they are: > >I am not using RHIDE at this time, I am using an editor called >"Multi-Edit". To be honest, I didn't even know what RHIDE was >until I was asked if I used it or not! I did check it out though, and >I may start using it more...but I digress! > >I have used the following command lines in an attempt to compile >just one of the modules with a simple "cout" main (it also declares >and uses an instance of the class I am compiling, because I read >in one of the archived mail messages that the compiler might want >an instance declared): > > gcc -Wall -o mime64.exe mime64.cpp (didn't expect this to work) > gcc -Wall -o mime64.exe mime64.cpp -lgpp (ditto) > gcc -Wall -o mime64.exe mime64.cpp -lgpp -lstdcxx (SHOULD work) > gxx -Wall -o mime64.exe mime64.cpp (all these should work) > gxx -Wall -o mime64.exe mime64.cpp -lgpp > gxx -Wall -o mime64.exe mime64.cpp -lgpp -lstdcxx > > / gcc -Wall -c mime64.cpp > < gcc -Wall -o mime64.exe mime64.o (tried the libraries above also) > \ gxx -Wall -o mime64.exe mime64.o (tried the libraries above also) > >Here is the output of the verbose build attempt from RHIDE (couldn't capture the >output otherwise - scrolled offscreen).... > > Compiling: mime64.cc > Reading specs from c:/djgpp/lib\specs > gcc version 2.7.2.1 > c:/djgpp/bin\cpp.exe -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=7 -Dunix -Di386 -DGO32 -DMSDOS -DDJGPP=2 -DDJGPP_MINOR=1 -D__unix__ -D__i386__ -D__GO32__ -D__MSDOS__ -D__DJGPP__=2 -D__DJGPP_MINOR__=1 -D__unix -D__i386 > GNU CPP version 2.7.2.1 (80386, BSD syntax) > #include "..." search starts here: > #include <...> search starts here: > c:/djgpp/lang/cxx > c:/djgpp/include > c:/djgpp/contrib/grx20/include > /usr/local/lib/g++-include > /usr/local/include > /usr/local/go32/include > /usr/local/lib/gcc-lib/go32/2.7.2.1/include > /usr/include > End of search list. > c:/djgpp/bin\cc1plus.exe c:/djgpp/tmp/RHaaaaaa\ccbaaaaa -quiet -dumpbase mime64.cc -g -Wall -version -o c:/djgpp/tmp/RHaaaaaa\cccaaaaa > GNU C++ version 2.7.2.1 (80386, BSD syntax) compiled by GNU C version 2.7.2.1 > c:/djgpp/bin\as.exe -o mime64.o c:/djgpp/tmp/RHaaaaaa\cccaaaaa > no errors > Creating: mime64.exe > Error: mime64.o: In function `mime64::mime64(void)': > mime64.cc(12) Error: undefined reference to `mime64::encode_string' > mime64.cc(14) Error: undefined reference to `mime64::encode_string' > mime64.cc(16) Error: undefined reference to `mime64::encode_string' > Error: mime64.cc(.text+0xda): undefined reference to `mime64::encode' > mime64.cc(17) Error: undefined reference to `mime64::decode' > Error: mime64.cc(.text+0x10d): undefined reference to `mime64::encode_string' > Error: mime64.o: In function `mime64::Encode64(basic_string > &)': > mime64.cc(45) Error: undefined reference to `mime64::encode' > mime64.cc(51) Error: undefined reference to `mime64::encode' > mime64.cc(54) Error: undefined reference to `mime64::encode' > mime64.cc(58) Error: undefined reference to `mime64::encode' > mime64.cc(59) Error: undefined reference to `mime64::encode' > Error: mime64.o: In function `mime64::Decode64(basic_string > &)': > mime64.cc(94) Error: undefined reference to `mime64::decode' > Error: mime64.cc(.text+0x505): undefined reference to `mime64::decode' > Error: mime64.cc(.text+0x534): undefined reference to `mime64::decode' > Error: mime64.cc(.text+0x563): undefined reference to `mime64::decode' > mime64.cc(109) Error: undefined reference to `mime64::decode' > Error: mime64.o(.text+0x61f):mime64.cc: more undefined references to `mime64::decode' follow > There were some errors *Do* you actually define the member functions `mime64::encode',`decode' and `encode_string'? Apparently you need to. If this doesn't help, post as little of the source as still causes the errors. Nate Eldredge eldredge AT ap DOT net