[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
undefined reference link errors
From: |
Srini |
Subject: |
undefined reference link errors |
Date: |
16 Mar 2005 00:05:43 -0800 |
User-agent: |
G2/0.2 |
Hello,
I searched thru this group for topics relevant to my issue. Found many
of them, but none of them seemed to solve my problem.
These are the errors I'm getting...
[snip]
raw_request.o(.text+0x29): In function
`RawRequest::RawRequest[not-in-charge]()':
: undefined reference to `Buffer::Buffer[in-charge]()'
raw_request.o(.text+0x83): In function
`RawRequest::RawRequest[in-charge]()':
: undefined reference to `Buffer::Buffer[in-charge]()'
raw_request.o(.text+0x396): In function `RawRequest::doIO()':
: undefined reference to `Configuration::getDevice(unsigned,
std::basic_string<char, std::char_traits<char>, std::allocator<char>
>&)'
raw_request.o(.text+0x3f7): In function `RawRequest::doIO()':
: undefined reference to `Configuration::getBlockSize()'
collect2: ld returned 1 exit status
[/snip]
I've the object files of the 4 class implementations...
request.o for "class Request"
raw_request.o for "class RawRequest : public Request"
configuration.o for "class Configuration"
buffer.o for "class Buffer"
'Request' class has a virtual destructor and I've provided the
definition for it in request.cpp.
'Configuration' class is a singleton class and there's a static pointer
to the only object within the class.
None of these are template classes.
I'm compiling each of them as follows...
g++ -c -ansi buffer.cpp
g++ -c -ansi request.cpp
g++ -c -ansi raw_request.cpp
g++ -c -ansi configuration.cpp
I've a test program...
---
#include "raw_request.h"
#include "configuration.h"
std::string file("sample.conf");
Configuration globalConf( file );
int main()
{
RawRequest req(WRITE, 0, 0, 0xcafebabe);
req.doIO();
return 0;
}
---
g++ tstrawreq.cpp buffer.o request.o raw_request.o configuration.o
This gives me the errors that I mentioned earlier... Please let me know
what I'm doing wrong in here. Thanks for your time in advance.
Regards,
Srinivas
- undefined reference link errors,
Srini <=