I cannot link object files. Compilation works fine, but the linker gives me these error messages:
testArguments.o: In function
Z6__mainiPPc':
Arguments::Arguments()'
/cygdrive/c/Users/Lukas/work/ProxyServer/src/test/testArguments.cpp:5:
undefined reference to
/cygdrive/c/Users/Lukas/work/ProxyServer/src/test/testArguments.cpp:6:
undefined reference toArguments
_Unwind_Resume' testArguments.o: In function::insertItem(int)'
/cygdrive/c/Users/Lukas/work/ProxyServer/src/test/testArguments.cpp:8:
undefined reference to
ZNSt10_List_baseIiSaIiEED2Ev':
_Unwind_Resume' testArguments.o: In function
/usr/lib/gcc/i686-pc-cygwin/4.8.2/include/c++/bits/stl_list.h:378:
undefined reference to
ZN9__gnu_cxx13new_allocatorISt10_List_nodeIiEE10deallocateEPS2_j':
operator delete(void*)'
/usr/lib/gcc/i686-pc-cygwin/4.8.2/include/c++/ext/new_allocator.h:110:
undefined reference to
testArguments.o:testArguments.cpp:(.eh_frame+0x13): undefined
reference to__gxx_personality_v0'
__gxx_personality_v0' Makefile:7: recipe for
testArguments.o:testArguments.cpp:(.eh_frame$_ZNSt10_List_baseIiSaIiEED2Ev+0x13):
undefined reference to
target 'tests' failed
But these functions are defined in the cpp file (Argument::Arguments() Arguments::insertItem(int)
Here is my header file:
#ifndef ARGUMENTS_H
#define ARGUMENTS_H
#include
using std::list;
template
class Arguments{
public:
Arguments(list args);>
Arguments()>;
void insert>Item(T item);
list getValues();
private:
list values;
};
#endif
Here the cpp file:
#include "include/Arguments.h"
#include
using std::list;
template Arguments::Arguments(list args) {
values = args;
}
template Arguments::Arguments() {
}
template void Arguments::insertItem(T argument){
values.push_back(argument);
}
template list Arguments::getValues() {
return this.values;
}
No comments:
Post a Comment