G
GammaJoe
I'm relatively new to C++, and so when I ran across these linker
errors, I really didn't know how to fix them. I did a groups.google
search, and found plenty of issues with parameterized classes, or
using the wrong compiler, or a variety of other things that don't
apply to my problem. So, if anyone could help me out, that'd be
great.
DummyTester.cpp:
#include "DummyClass.h";
#include "CommunicatorImplementation.h";
int main(){
CommunicatorImplementation comm_imp;
Communicator * util = util_imp.Clone();
DummyClass dc(*util);
return 0;
}
When I run:
$g++ -I../src/ -I../../utils/src DummyTester.cpp
I get:
/tmp/ccxLnKku.o(.text+0x19): In function `main':
: undefined reference to
`CommunicatorImplementation::CommunicatorImplementation[in-charge]()'
/tmp/ccxLnKku.o(.text+0x3d): In function `main':
: undefined reference to
`DummyClass:ummyClass[in-charge](Communicator const&)'
/tmp/ccxLnKku.o(.text+0x4c): In function `main':
: undefined reference to
`CommunicatorImplementation::~CommunicatorImplementation
[in-charge]()'
/tmp/ccxLnKku.o(.text+0x63): In function `main':
: undefined reference to
`CommunicatorImplementation::~CommunicatorImplementation
[in-charge]()'
/tmp/ccxLnKku.o(.gnu.linkonce.t._ZNK17CommunicatorImplementation5CloneEv+0x24):
In function `CommunicatorImplementation::Clone() const':
: undefined reference to
`CommunicatorImplementation::CommunicatorImplementation[in-charge](CommunicatorImplementation
const&)'
collect2: ld returned 1 exit status
DummyClass, Communicator, and CommunicatorImplementation are
pre-established (and non-parameterized) modules and (in theory) should
not need any alteration. What do I need to change in my code or in
the way I run the compiler/linker that will make this program link?
Thanks in advance!
Joe
errors, I really didn't know how to fix them. I did a groups.google
search, and found plenty of issues with parameterized classes, or
using the wrong compiler, or a variety of other things that don't
apply to my problem. So, if anyone could help me out, that'd be
great.
DummyTester.cpp:
#include "DummyClass.h";
#include "CommunicatorImplementation.h";
int main(){
CommunicatorImplementation comm_imp;
Communicator * util = util_imp.Clone();
DummyClass dc(*util);
return 0;
}
When I run:
$g++ -I../src/ -I../../utils/src DummyTester.cpp
I get:
/tmp/ccxLnKku.o(.text+0x19): In function `main':
: undefined reference to
`CommunicatorImplementation::CommunicatorImplementation[in-charge]()'
/tmp/ccxLnKku.o(.text+0x3d): In function `main':
: undefined reference to
`DummyClass:ummyClass[in-charge](Communicator const&)'
/tmp/ccxLnKku.o(.text+0x4c): In function `main':
: undefined reference to
`CommunicatorImplementation::~CommunicatorImplementation
[in-charge]()'
/tmp/ccxLnKku.o(.text+0x63): In function `main':
: undefined reference to
`CommunicatorImplementation::~CommunicatorImplementation
[in-charge]()'
/tmp/ccxLnKku.o(.gnu.linkonce.t._ZNK17CommunicatorImplementation5CloneEv+0x24):
In function `CommunicatorImplementation::Clone() const':
: undefined reference to
`CommunicatorImplementation::CommunicatorImplementation[in-charge](CommunicatorImplementation
const&)'
collect2: ld returned 1 exit status
DummyClass, Communicator, and CommunicatorImplementation are
pre-established (and non-parameterized) modules and (in theory) should
not need any alteration. What do I need to change in my code or in
the way I run the compiler/linker that will make this program link?
Thanks in advance!
Joe